/* lab 3 - conditionals & loops & ASCII */


#include <stdio.h>

int main(void) {
	char input;
	int windSpeed, goAgain = 1;

	printf("\n\n");
	while (goAgain) {
		printf("Enter a character: ");
		scanf(" %c", &input);
		printf("\n");

		printf("\n    The decimal representation of your character %c is %d.\n\n", 
				  input, input);
		windSpeed = 2 * input;

		printf("Would (2 * '%c') be a hurricane??\n", input);
		printf("\n    (2 * '%c') = %d\n", input, windSpeed);

		if (windSpeed >= 155)
			printf("    Wind speed of %d is a Category 5 hurricane.\n", 
				     windSpeed);
		else if (windSpeed >= 131)
			printf("    Wind speed of %d is a Category 4 hurricane.\n", 
				     windSpeed);
		else if (windSpeed >= 111)
			printf("    Wind speed of %d is a Category 3 hurricane.\n", 
				     windSpeed);
		else if (windSpeed >= 96)
			printf("    Wind speed of %d is a Category 2 hurricane.\n", 
				     windSpeed);
		else if (windSpeed >= 74)
			printf("    Wind speed of %d is a Category 1 hurricane.\n", 
				     windSpeed);
		else
			printf("    Wind speed of %d is not strong enough to be "
				    "a hurricane.\n", windSpeed);

		printf("- - - - - - - - - - - - - - - - - - - - - "
		    	 "- - - - - - - - - - - - - -\n\n");
		printf("Enter 1 to go again or 0 to quit: ");
		scanf("%d", &goAgain);
		printf("\n\n");
	}

	return 0;
}
