Homework
/*This program will be used to convert the temperatures from Fahrenheit to Celsius and from Celsius to Fahrenheit for the Temperature Convention Center. */
Declare Celsius and Fahrenheit as float
Declare x,y as char
Write: “Welcome to the Temperature Conversion Center! This program will allow the user to”
Write: “enter a series of Degree Celsius temperatures that you want to convert to Degree”
Write: “Fahrenheit or Degrees Fahrenheit to Degrees Celsius! Your converted temperatures”
Write: “will be displayed on the screen!”
Fahrenheit = x Doesn’t make sense. Char can only hold one letter. Plus you only need 1 char, The user is then asked to input a character which will determine how the if statement looks.
Input y = Celsius
The if statement goes right here...You really need to go from top to bottom and look what your program does. The way you have it right now does not make sense. I will write it in English and you can try to put it in to Pseudo. Ask the user to input a letter which ist he char. If the char is a certain letter, then do Celsius to Fahrenheit conversion . If the letter is some other letter the program does Fahrenheit to Celsius conversion. Really go over the progam in your head.
Write: “Enter Fahrenheit and press enter when done”
Input Fahrenheit
Celsius = (Fahrenheit – 32) * 1.8
Write: “Enter Celsius and press enter when done”
Input Celsius
Fahrenheit = (Celsius1 * 9)/5 + 32
Write: “Enter Fahrenheit and press enter when done”
If degrees Fahrenheit “enter x” This means nothing… the computer does not know what you mean here. You need to work with variables and their names. The conversion itself is also part of the If statement and not before it.
Write: +Fahrenheit+ “degrees Fahrenheit is” +Celsius+ “degrees Celsius \n”
Else
If degrees Celsius “enter y”
Write: +Celsius+ “degrees Celsius is” +Fahrenheit+ “degrees Celsius \n”
Write: “The conversion from Celsius to Fahrenheit and Fahrenheit to Celsius has ended,”
Write: “Thank you for using this program!”
End If
End If