Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Input: The temperature in Fahrenheit degrees, provided interactively by the user

ID: 3783121 • Letter: I

Question

Input: The temperature in Fahrenheit degrees, provided interactively by the user. The input value will be a real number. Output: Display the Fahrenheit input temperature and the corresponding Celsius temperature, also a real number. The results may be displayed on the screen. Provide a simple message to explain the output (i.e., one sentence). At least the Java output should be formatted neatly, with one decimal position displayed in the numbers. Sample output: 212.0 degrees Fahrenheit = 100.0 degrees Celsius. Programming: Include at least some documentation in this simple program. Initial comments at the beginning of each file should provide the program name, your name, and a simple statement of what the program does. Include one other comment somewhere in each program, either in-line or on a separate line. Include a meaningful prompt for the user. To avoid doing data conversions or losing data through integer truncations, use only real numbers in the calculations. A number constant will be treated as a real number if you include a decimal point and a trailing O. Formula: C = 5.0/90 (F - 32.0) Submissions: Submit an electronic copy of the of your algorithm fist in the D2L dropbox. Due date is listed above. Then submit the two source code files in the D2L dropbox. Due date is listed above. Algorithm is worth 6 points. Each program is worth 7 points. Include your initials at the beginning of the name of any program submission.

Explanation / Answer

C++ code for the problem

#include <bits/stdc++.h>
using namespace std;

int main()
{
float tmp_f;
cout << "Enter The Temperature in farenheit"<<endl;   
cin >> tmp_f; // take input The Temperature in farenheit
float tmp_c = (5.0/9.0)*(tmp_f - 32); // convert into degree celcius
cout << tmp_f << " farenheit is Equivalent to " << tmp_c << " degree celcius" << endl; // print the output
return 0;
}

Sample Output:

Enter The Temperature in farenheit
212
212 farenheit is Equivalent to 100 degree celcius