Group: Guest
Posts: 5,799
Joined: May 26 2008
Contact:
Offline PMPoints:
109.60
forgot how to use char variables
what i need to do is
user is entering either c, C, f, F
need to make char variables for each and do a conversion depending on what they type in
so like
if they enter c or C have to do 1 thing
then f and F is another
i just dont remember what to type to make it a char variable
here's the actual problem
Write a C++ program that prompts the user to specify if they want to convert from Celsius to Fahrenheit, or Fahrenheit to Celsius. Use a char type variable for this input, and ask the user to enter a C or an F. Your program should handle input of upper or lower case characters. If the user enters anything other than C© or F(f), display the message "Invalid Entry" and end the program using an exit(0) statement.
Group: Members
Posts: 74,769
Joined: Aug 5 2007
Contact:
Offline PMPoints:
7,730.25
you have to check for the specific ascii value for the character