Browse Source

Put menu into its own function

master
ludwig 2 years ago
parent
commit
ca77e8727e
  1. 14
      converter.cpp

14
converter.cpp

@ -2,6 +2,15 @@
using namespace std; using namespace std;
void Menu(){
cout << "Simple temperature converter \n";
cout << "Conversion options \n [1]C to F \n [2]F to C \n [3]Quit" << endl;
cout << "Select option [1-3]: ";
}
double C, F; double C, F;
double convertC(double C, double F){ double convertC(double C, double F){
@ -16,10 +25,7 @@ double convertF(double C, double F){
int main() { int main() {
int input; int input;
Menu();
cout << "Simple temperature converter \n";
cout << "Conversion options \n [1]C to F \n [2]F to C \n [3]Quit" << endl;
cout << "Select option [1-3]: ";
cin >> input; cin >> input;
if (input == 3) { if (input == 3) {

Loading…
Cancel
Save