I honestly have no clue how to go about this. Need some assistance on the following questions:
Modify the program to subtract (num1 – num2). If num2 is greater than num1, swap the values of the variables using a variable named temp, using the partial code below.
if (num2 > num1) { temp = num2; ____________ ____________ }
- Problem Specification:
Code the IPO Charts shown below for main function, getFahrenheit function, and calcCelsius function. Enter your C++ instructions into a source file named yourLastName_U5W1_EX1.cpp. Enter any appropriate comments in your code. Display the Celsius temperature in fixed-point notation with no decimal places. Save and then run the program. Test the program using the following, Fahrenheit temperatures: 32 and 212.
Main Function
IPO Chart Information
Fahrenheit temperature double fahrenheit = 0.0;
Processing:
none
Output:
Celsius temperature double celsius = 0.0;
Algorithm:
1. call getFahrenheit to get the Fahrenheit temperature
2. call calcCelsius to calculate the Celsius temperature, pass the Fahrenheit temperature
3. display the Celsius temperature (in fixed-point notation with no decimal places)
getFahrenheit Function
IPO Chart Information
Input:
Fahrenheit temperature double fahrenheitTemp = 0.0;
Processing:
none
Return Output:
Fahrenheit temperature
Algorithm:
1. Enter the Fahrenheit temperature cout << “Enter temperature in Fahrenheit”;
2. Return the Fahrenheit temperature
calcCelsius Function
IPO Chart Information
Input:
Fahrenheit temperature as formal parameter double fahrenheitTemp
Processing:
none
Return Output:
Celsius temperature double celsiusTemp = 0.0;
Algorithm:
1. Celsius temperature = 5.0 / 9.0 * (Fahrenheit temperature – 32.0)
2. Return the Celsius temperature