I need the source code in c++. Thank you! The formula for converting Celsius val
ID: 3738422 • Letter: I
Question
I need the source code in c++. Thank you!
The formula for converting Celsius values to Fahrenheit is: F (9/5)C+32 You are to write a complete, well documented program that will allow the user to enter a Celsius value, and the program should respond with the corresponding Fahrenheit temperature. The program should consist of a while loop that allows the user to enter a new Celsius value until the user enters a sentinel value (-1000 would work). Each time the loop executes, the user will be able to enter only one Celsius value. Both your prompt to the user and the message that states the Fahrenheit valuc should be clear and easy to understand. As mentioned before, in this program and all others this semester, you should inchudea set of boxed in comments just after the program header that are similar to what is shown The words in bold should appear in the places shown. The non-bold text should below. match the program being described. epe eace*38834tia*388838888388388433338488844 Instructor: Charles Babbage Program Name: Find Averages Date Due: April 8, 1854 (50%) (25%) * Programmer: Ada Lovelace Program #: + Date Assigned: April 1, 1854 * Grade Correctness Style Comments Total (25%) * Program Description: This program will allow the user to enter 5 integer * values and will then find the sum and the average of the numbers. The sum is " treated as an integer and the average as a real. The average is rounded and * shown to the nearest hundredth. 4*44Explanation / Answer
// CTOF.cpp File
/**********************************************************************************
Program Description: This program will allow user to comnvert celcious values into
* farenhite values.
* The program will ask for Celsious value as input untill sentinal value (-1000) is
* not entered and display converted Farenhite value.
**********************************************************************************/
#include "iostream"
#include "conio.h"
#define EXIT_VALUE -1000
using namespace std;
float CelsiousToFarenhite(float& celsious)
{
float farenhite = 0.0;
farenhite = ((9/5)*celsious) + 32;
return farenhite;
}
int main()
{
float userValue = 0.0;
cout << "This Program convets Celcious value to Farenhite." << endl << "Please Enter -1000 to exit." << endl;
while(userValue != EXIT_VALUE)
{
cout << "Enter value in Celcious:";
cin >> userValue;
if(userValue == EXIT_VALUE)
break;
cout << endl << "Converted Farenhite Value is : " << CelsiousToFarenhite(userValue) << endl;
}
return 0;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.