/* Jeffrey "Jay" Moody
2/7/23
Section 003
Lab 3
Converting any character into an decimal, doubling it, and
calculating wind speed. No comments, as code is self-explanatory.
*/

#include <stdio.h>

int main (void)   {
	
	char character;
	int speed,loop=1;
	
	while(loop==1) {
		printf("\nEnter a character: ");
		fscanf(stdin," %c",&character);
		
		printf("\n   The decimal representation of your character");
		printf(" %c is %d.\n\n",character,character);
		
		speed=2*character;
		printf("Would (2 * '%c') be a hurricane??\n\n",character);
		printf("   (2 * '%c') = %d\n",character,speed);
		
		if(speed<74)
			printf("   Wind speed of %d is not strong enough to be a"
			       " hurricane.\n",speed);
		else if(speed<=95)
			printf("   Wind speed of %d is a Category 1 hurricane.\n",speed);
		else if(speed<=110)
			printf("   Wind speed of %d is a Category 2 hurricane.\n",speed);
		else if(speed<=130)
			printf("   Wind speed of %d is a Category 3 hurricane.\n",speed);
		else if(speed<155)
			printf("   Wind speed of %d is a Category 4 hurricane.\n",speed);
		else
			printf("   Wind speed of %d is a Category 5 hurricane.\n",speed);
		
		printf("- - - - - - - - - - - - - - - - - -"
		       " - - - - - - - - - - - - - - - - -"
		       "\n\nEnter 1 to go again or 0 to quit: ");
		fscanf(stdin," %d",&loop);
		printf("\n");
	}
	
	return 0;
}


