Introduction - Getting Started
Flow of Control
The Freeform Project
In this project, you’ll learn to create a program that converts temperature from Fahrenheit to Celsius and vice versa. Generally, these project programs are going to be a bit extensive. These projects primarily involve a learning strategy that you must uphold. First, we grasp the program thoroughly and then we do it without having to look at it.
So without further due let’s get straight into it.
float frh, cls, nfrh, ncls ;
cout<<"----------Temperature Conversion Menu----------";
cout<<"\n\n\nFahrenheit to Celsius\n\n";
cout<<"Input the temperature in Fahrenheit: ";
cout<<"Temperature in Celsius: "<<ncls;
cout<<"\n\n\nCelsius to Fahrenheit\n\n";
cout<<"Input the temperature in Celsius: ";
cout<<"Temperature in Fahrenheit: "<<nfrh;
Formulas used in this program: Celsius= (Fahrenheit-32.0)/1.8
This is what the variables symbolize:
nfrh– New Fahrenheit(after conversion)
ncls- New Celsius(after conversion)
Execution of the Program
Now the program is quite self-explanatory. Now Compile the program. If the compiler shows errors then check my program and resolve it. Then Run the program. Here’s the output:
Now it’s time to do it yourself without having to look at the source code. Feel free to mess around with the program to understand in-depth what each statement does. Don’t forget to save your program.
That’s it for today, see you next week!!!