/*
Haylee Smith
2/10/2023
CPSC 1010 Lab Section 004, Spring 2023
Lab #3
Takes in a character, calculates wind speed, and uses wind speed to state 
the category of the hurricane if wind speed is strong enough to be a hurricane.
*/

#include <stdio.h>
int main(){
	char character;
	int wind_speed;
	int repeat;
	printf("Enter a chracter: ");
	fscanf(" %c", &character);
	printf("\nThe decimal representation of your chracter %c is %d.\n",
	character, character);
	wind_speed = 2 * character;
	printf("The wind speed is %d.\n", wind_speed);
	if((wind_speed >= 74) && (wind_speed <= 95)){
		printf("Wind speed of %d is a Category 1 hurricane.\n", wind_speed);
	} else if((wind_speed >= 96) && (wind_speed <= 110)){
		printf("Wind speed of %d is a Category 2 huricane.\n", wind_speed);
	} else if((wind_speed >= 111) && (wind_speed <= 130)){
		printf("Wind speed of %d is a Cateogry 3 hurricane.\n", wind_speed);
	} else if((wind_speed >= 131) && (wind_speed <= 155)){
		printf("Wind speed of %d is a Cateogry 4 hurricane.\n", wind_speed);
	} else if(wind_speed >= 155){
		printf("Wind speed of %d is a category 5 hurricane.\n", wind_speed);
	} else if(wind_speed < 74){
		printf("Wind speed of %d is not strong enough to be a hurricane.\n", wind_speed);
	}
	printf("Enter 1 to go again or 0 to quit: \n");
	fscanf(" %i", &repeat);
	while(repeat == 1){
		printf("Enter a chracter: ");
		fscanf(" %c", &character);
		printf("\nThe decimal representation of your chracter %c is %d.\n",
		character, character);
		wind_speed = 2 * character;
		printf("The wind speed is %d.\n", wind_speed);
		if((wind_speed >= 74) && (wind_speed <= 95)){
      	printf("Wind speed of %d is a Category 1 hurricane.\n", wind_speed);
   	} else if((wind_speed >= 96) && (wind_speed <= 110)){
      	printf("Wind speed of %d is a Category 2 huricane.\n", wind_speed);
   	} else if((wind_speed >= 111) && (wind_speed <= 130)){
      	printf("Wind speed of %d is a Cateogry 3 hurricane.\n", wind_speed);
   	} else if((wind_speed >= 131) && (wind_speed <= 155)){
      	printf("Wind speed of %d is a Cateogry 4 hurricane.\n", wind_speed);
   	} else if(wind_speed >= 155){
      	printf("Wind speed of %d is a category 5 hurricane.\n", wind_speed);
   	} else if(wind_speed < 74){
      	printf("Wind speed of %d is not strong enough to be a hurricane.\n", wind_speed);
   	}
		printf("Enter 1 to go again or 0 to quit: \n");
		fscanf(" %i", &repeat);
	}
	return 0;
}


