Program is supposed to convert celcius to farenhiet or vice versa, then display a start and end temperature with conversions and original entries. There is an increment our prof had us add, but I don't see any reason for having it; and it is not included in the mathematical equations. This is supposed to use user defined functions and display on a table. This is what I have and keep getting an invalid null pointer message. Here's what I have:
void displayMenu(char& selc)
{
cout << "Incremented Conversion Program" << endl;
cout << "Input the letter F for Farenhiet" << endl;
cout << "Input the letter C for Celcius" << endl;
cout << "Or Input the letter Q to quit the Program." << endl;
cout << "\nWhat would you like converted, Celcius or Farenhiet?" << endl;
cin >> selc;
}
char getMenuSelection(char& temp)
{
switch (temp)
{
case 'c':
case 'C':
cout << "You will convert Celcius to Farenhiet" << endl;
break;
case 'f':
case 'F':
cout << "You will convert Farenhiet to Celcius" << endl;
break;
case 'q':
case 'Q':
cout << "Program Terminated." << endl;
break;
default:
cout << "Improper Input, please select one of the following options: C, F, or Q." << endl;
}
return 0;
}
string displayTable(string tableType, char selc)
{
if (selc =='c' || 'C')
{
tableType = " C to F ";
}
else if (selc =='f' || 'F')
{
tableType = " F to C ";
}
cout << tableType << endl;
cout << setw(26) << "INPUTS" << setw(27) << "OUTPUTS" << endl;
cout << left << "Main" << " " << "Start" << " " << "Stop" << endl;
cout << left << "Input" << " " << "Temperature" << " " << "Temperature" << " " << "Increment" << endl;
cout << endl;