/*
Jackson Brown
2/7/23
S23
Lab 3
*/


#include <stdio.h>
#include <stdlib.h>

int main (void) {

char input;

int again = 1;

while (again == 1) {

printf("Enter a character: ");
scanf(" %c", &input);
printf("\n");
 printf("\n");
 
 int intrep = (int)input;
 int normRep = intrep;
 intrep  = intrep *2;


 
printf("\tThe decimal representation of your character %c is %d.\n\n", input, normRep);

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

 
 printf("\t(2 * '%c') = %d\n", input, intrep);


if (intrep >= 155) {

  printf("\tWind speed of %d is a Category 5 hurricane.\n\n", intrep);

}

else if (intrep >= 131 && intrep <= 155) {

  printf("\tWind speed of %d is a Category 4 hurricane.\n\n", intrep);

}

else if (intrep >= 111 && intrep <= 130) {

  printf("\tWind speed of %d is a Category 3 hurricane.\n\n", intrep);

}

else if (intrep <= 110 && intrep >= 96) {

  printf("\tWind speed of %d is a Category 2 hurricane.\n\n", intrep);

}

else if (intrep <= 95 && intrep >= 74) {

  printf("\tWind speed of %d is a Category 1 hurricane.\n\n", intrep);

}

else {

  printf("\tWind speed of %d is not strong enough to be a hurricane.\n", intrep);

}

 printf("- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n\n"); 

 printf("Enter 1 to go again or 0 to quit: ");

scanf("%d", &again);

if (again == 0) {
  exit(0);
}

printf("\n\n");
}
return 0;

}
