// Temperature conversion in cpp.
// a simple temperature conversion program written by Charming Prince.
#include <iostream>
using namespace std;
int main ()
{
int temp; // values to determine temperature
int cel; // temperature in degree celsius
int fah; // temperature in degree fahrenheit
int value;
cout << "What do you want to convert? please select from below!" << endl;
// Prompt User
cout << " 1.Convert from Fahrenheit to Degree celsius. " << endl;
cout << " 2.Convert from Degree celsius to Fahrenheit. " << endl;
cin >> value; // user selects
//a value by either pressing 1 or 2.
// validation of pressing a correct number is determined.
if ( value==1 )
{
cout << " Please insert a number to change from Fahrenheit to Degree Celsius "
<< endl;
cin >> temp;// prompts Value for user to enter
cel = ((temp -32) * 5/9);
cout << " Your value is,"<< cel << " degree celsius "
<< endl; // result to be displayed
}
else if (value==2)
{
cout << " Please insert a number to change from Degree celsius to Fahrenheit "
<< endl;
cin >> temp;// prompts Value for user to enter
fah = (temp * 9/5 + 32);
cout <<" Your value is,"<< fah <<" degree fahrenheit"
<< endl;// result to be displayed
}
else {
cout << " You didn't make a selection yet?";
//shows when any other value than 1 or 2 is pressed.
}
return 0; // end of program
}
A free C++ Compiler is available online for download, Just Google Code-Block Compiler (simply click on the link to go to their download page) and you’ll have available links provided for you to be able to download it. its an open source application so it wouldn’t be a problem trying to download it.
you can use the codes above, modify it and make it unique on your own!…
Thanks for the info
Great script, shame about the output.
Simple things please the simple minds….
Hope someone finds a use for this useless crap
What a waste of fucking time you wanker
Thank you for your guidance!^_^