//Ashton Krol
//9/23/2022
//CPSC 1010 Section 002
//Lab 4
///The user will be prompted to enter a capital letter, followed by a lowercase letter, an integer between 33-126 and then another integer. This informaation will then be stored in an output file that will tell the user what ASCII values their letter correlate too along with their first integer. The last integer will be cubed.
 
#include<stdio.h>
#include<math.h>  
int main(void)	
{

	char userInput1, userInput2;
	int userInput3, userInput4;

	fprintf(stderr, "Enter a capital letter: "); 
		fscanf(stdin, " %c", &userInput1);  
	fprintf(stderr, "Enter a lowercase letter: ");
		fscanf(stdin, " %c", &userInput2); 
	fprintf(stderr, "Enter an integer (33 - 126): "); 
		fscanf(stdin, "%d", &userInput3); 
	fprintf(stderr, "Enter an integer: ");  
		fscanf(stdin, "%d", &userInput4);
	


// 

	fprintf(stdout,"The lowercase of %c is %c\n", userInput1, userInput1+32);
	fprintf(stdout,"The ASCII values for %care:\n");
	fprintf(stdout, "%-16s%-16s%-16s\n", "DECIMAL", "OCTAL", "HEX");
	fprintf(stdout, "%-16d%#-16o%#-16x\n",userInput1+32,userInput1+32,userInput1+32); 
	
	
	fprintf(stdout,"The uppercase of %c is: %c\n", userInput2, userInput2-32);
       	fprintf(stdout,"The ASCII values for %care:\n");
        fprintf(stdout, "%-16s%-16s%-16s\n", "DECIMAL", "OCTAL", "HEX");
        fprintf(stdout, "%-16d%#-16o%#-16x\n",userInput2-32,userInput2-32,userInput2-32);
	

	fprintf(stdout,"The ASCII character of %d is: %c\n",userInput3,userInput3);
	fprintf(stdout, "%d cubed is %.1f\n", userInput4, pow(userInput4,3));  

	return 0;
}	
