Most programs require the same logic to be repeated for several sets of data. The most efficient way to deal with this situation is to establish a looping structure in the algorithm that will cause the processing logic to be repeated a number of times The DOWHILE structure will continue to repeat a group of statements while a condition remains true.
In this scenario, every day, a metal lab receives 15 temperature readings of boiled metal expressed in degrees Fahrenheit. A program needs to be written that will accept each Fahrenheit temperature, convert it to Celsius and display the converted temperature to the screen. After 15 temperatures have been processed, the message ‘All temperatures processed’ is to be displayed on the screen.
You need to write a C++ program that converts Fahrenheit to Celsius and follows the guidelines in this handout. For up to 25 extra credit points (not good towards exams) provide a user menu option to convert from Fahrenheit to Celsius and Celsius to Fahrenheit (see sample code below).
It is also time to start adding comments to your code. Please make sure that you put the appropriate comments in your code (see sample below).
In this project, the programmer will need (notes):
How do you convert between Fahrenheit and Celsius temperature? c_temp = (f_temp – 32) * 5 / 9
To convert from Farenheit to Celsius, use this equation:
C=(F-32) x 5/9
To convert from Celsius to Farenheit, use this equation:
F=(C x 9/5) + 32
Here's a trick for converting Celsius to Farenheit in your head:
EXAMPLE: let's use 30 degrees C as an example.
Use this web site to see conversion charts.
http://www.weatherquestions.com/How_do_you_convert_temperature.htm