Question: In this exercise, you will modify the program from TRY THIS Exercise 11. If necessary, create a new project named ModifyThis12 Project, and save it

In this exercise, you will modify the program from TRY THIS Exercise 11. If necessary, create a new project named ModifyThis12 Project, and save it in the Cpp8\Chap10 folder. Copy the instructions from the TryThis11.cpp file into a source file named ModifyThis12.cpp. (Alternatively, you can enter the instructions shown later in Figure 10-32 into the ModifyThis12.cpp file.) Change the filename in the first comment to ModifyThis12.cpp. Add a void function named calcFahrenheit to the program. The program should now allow the user to convert the temperature he or she entered to either Celsius or Fahrenheit. Make the necessary modifications to the main function. Test the program appropriately.

//TryThis11.cpp converts Fahrenheit to Celsius //Created/revi sed by  on  #include  #include  using names pace std; //function prototype void calcCelsi us (double tempF, double &tempC); int main() { double fahrenheit = 0.0%3; double celsius = 0.0; cout « fahrenheit; calcCelsius(fahrenheit, celsius);" style="" class="fr-fic fr-dib">

//TryThis11.cpp converts Fahrenheit to Celsius //Created/revi sed by on #include #include using names pace std; //function prototype void calcCelsi us (double tempF, double &tempC); int main() { double fahrenheit = 0.0%3; double celsius = 0.0; cout "Enter Fahrenheit temperature: "; cin > fahrenheit; calcCelsius(fahrenheit, celsius); cout fixed setprecision (0); cout "Celsius temperature: " celsius end1; return 0; } // end of main function //***** function definitions***** void calccelsius(double tempF, double &tempC) { tempC = 5.0 / 9.0 * (tempF 32.0); } //end of calcCelsius function Figure 10-32

Step by Step Solution

3.43 Rating (185 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

ModifyThis12cpp converts Fahrenheit to Celsius or Fahrenheit to Celsius Createdrevised by on include ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related An Introduction Programming Questions!