#include <stdio.h>
#include <math.h>

/*
Jack Longfellow
09/20/2022
Section #4
Lab #4
Asks the user to enter a capital letter, lowercase letter, and integer between 33-126, and an additonal integer and then returns the ASCII values as the output.
*/

int main()	{

	char capital, lowercase;
	int range, num, caplow, caphigh;
	float cube;

	fprintf(stderr,"Enter a capital letter: ");
	fscanf(stdin," %c", &capital);
	
	caplow = capital + 32;
	
	fprintf(stdout,"The lowercase of %c is: %c\n", capital, caplow);
        fprintf(stdout,"The ASCII values for %c are: \n", caplow);
        fprintf(stdout,"%-16s%-16s%-16s\n", "DECIMAL", "OCTAL", "HEX");
        fprintf(stdout,"%-16d%#-16o%#-16x\n", caplow, caplow, caplow);

	fprintf(stderr,"Enter a lowercase letter: ");
	fscanf(stdin," %c", &lowercase);
	
  	caphigh = lowercase - 32;
	
	fprintf(stdout,"The uppercase of %c is: %c\n", lowercase, caphigh);
        fprintf(stdout,"The ASCII values for %c are:\n", caphigh);
        fprintf(stdout,"%-16s%-16s%-16s\n", "DECIMAL", "OCTAL", "HEX");
        fprintf(stdout,"%-16d%#-16o%#-16x\n", caphigh, caphigh, caphigh);



	fprintf(stderr,"Enter an integer (33 - 126): ");
	fscanf(stdin," %d", &range);
	fprintf(stdout,"The ASCII character of %d is: %c\n", range, range);



	fprintf(stderr,"Enter an integer: ");
	fscanf(stdin," %d", &num);

	cube = pow(num, 3);

	fprintf(stdout,"%d cubed is: %.1f\n", num, cube);


return 0;


}

