#include <iostream>
#include <string>
#include <cmath>
#include <iomanip>
using namespace std;
int main ()
{
char op= ' ';
int cstart, cend, increment, fstart, fend;
cout << "This program converts and calculates the increment between" << endl;
cout <<"celsius and fahrenheit temperatures"<< endl;
cout << endl << endl;
op = getmenu ();
switch (op)
{
case 'F':
case 'f':
cout << "Please enter the starting Fahrenheit temperature" <<endl;
cin >> fstart;
cout << "Please enter the ending fahrenheit temperature" << endl;
cin >> fend;
cout << "Please enter the increment" << endl;
cin >> increment;
cout << (5/9)*(fstart-32) << fend << endl;
break;
case 'C':
case 'c':
cout << "Please enter the starting Celsius temperature" <<endl;
cin >> cstart;
cout << "Please enter the ending Celsius temperature" << endl;
cin >> cend;
cout << "Please enter the increment" << endl;
cin >> increment;
break;
}
system ("pause");
return 0;
}
char getmenu ()
{
char op;
cout << "1. Press C to convert celsius to fahrenheit " <<endl;
cout << "2. Press F to convert fahrenheit to celsius " <<endl;
cout << "3. Press Q to quit the program " <<endl;
cin >> op;
return op;
}
i need getmenu to be a function.
I get "Error C3861: 'getmenu': identifier not found" and "error C2365: 'getmenu' : redefinition; previous definition was 'formerly unknown identifier'".
help?