/*Allan Cruz
February 7, 2023
Lab #3
Lab 003
Program that takes the decimal value of a character, doubles it, and returns with the appropriate hurricane level category.
*/
#include <stdio.h> 

int main() {
	char c;
	int decimal,repeat = 1;

	while (repeat){
		printf("Enter a character: \n");
		fscanf(stdin, " %c", &c);

		decimal = c;
		printf("The decimal representation of your character %c is %d.\n", c, decimal);
		printf("Would (2 * '%c') be a hurricane??\n", c);


		int windSpeed = decimal * 2;
		printf("(2 * '%c') = %d\n", c, windSpeed);

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

		printf("\n - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \n");
		printf("Enter 1 to go again or 0 to quit: \n");
		fscanf(stdin, "%d", &repeat);
		if (repeat == 0) {
			break;
		}
	}
	return 0;
}
