I am having all kinds of problems with my assignment. I have worked on it for hours and cannot get it to work properly. I am new to programming and it gets frustrating very fast for me. Here is the code I am currently working and i have attached my assignment with what the output should look like... any help would be wonderful...
//Assignment 4: Functions
//By: Curtis Davenport 02/13/08
#include <iostream>
#include <cmath>
using namespace std;
int temperatureF;
int temperatureC;
int choice;
int result;
int FahrenheittoCelsius(int);
int CelsiustoFahrenheit(int);
int main()
{
bool done;
done = false;
while(done == false)
{
cout << "Please select from the following \n";
cout << "Fahrenheit-to-Celsius [1], Celsius-to-Fahrenheit [2], Quit [3] \n";
cin >> choice;
if (choice == 1)
cout << "Enter the temperature in degree F to convert: << temperatureF <<";
cin >> temperatureF;
cout << "The temperature you have entered in F," << temperatureF << "is 5*(temperatureF-32)/9 C \n";
if (choice == 2)
cout << "Enter the temperature in degree C to convert: << temperatureC <<";
cin >> temperatureC;
cout << "The temperature you have entered in C," << temperatureC << "is ((9/5)*temperatureC)+32 F \n";
if (choice < 1)
cout << "Incorrect Choice. Try again.";
if (choice > 3)
cout << "Incorrect Choice. Try again.";
if (choice == 3)
{
bool done = true;
}
}
return 0;
}
int FahrenheittoCelsius(int)
{
result = 5*(temperatureF-32)/9;
return result;
}
int CelsiustoFahrenheit(int)
{
result = ((9/5)*temperatureC)+32;
return result;
}