//@Author Damien Bell
#include <iostream>
#include <cmath>
using namespace std;
void displayMenu();
void doCalcs(int, double, double);

int main(){
    int choice=0;
    double x=0, y=0, product=0;
    char quit =' ';
    while (quit != 'y'){
        displayMenu();
        cin >> choice; 
        
        cout <<"\nEnter a value for the first number: ";
        cin >> x;
        
        cout <<"\nEnter a value for the second number: ";
        cin >> y;       
        
        doCalcs(choice, x, y);
        
        
        
        cout <<"\nDo you want to quit? y/n ";
        cin >>quit;
    }
 return 0;
}

void displayMenu(){
   cout << "Press 1 to add" <<endl << "Press 2 to subtract" <<endl <<"Press 3 to multiply"<<endl;
   cout << "Press 4 to divide" <<endl << "Press 5 to raise a number to a power" <<endl <<"Press 6 to mod a number"<<endl;
   cout << "Please enter your choice: ";
}//End function displayMenu

void doCalcs(int menuChoice, double a, double b){
    switch(menuChoice){
        case 1:{
            cout << a << " + " << b << " = " <<a+b;
        }
        case 2:{
            cout << a << " - " << b << " = " <<a-b;
            break;
        }        
        case 3:{
            cout << a << " * " << b << " = " <<a*b;
            break;
        }        
        case 4:{
            cout << a << " / " << b << " = " <<a/b;
            break;
        }        
        case 5:{
            cout << a << " ^ " << b << " = " << pow(a, b);
            break;
        }        
        case 6:{
            cout << a << " % " << b << " = " << fmodf(a,b);
            break;
        }        
        default:{
            cout << "Something broke";
        }
        
        
        
        
        
        
    }//end switch
    
    
}//end function doCalc


