//@Author Damien Bell
#include <iostream>
#include <cmath>
using namespace std;
int main(){
    int choice=0;
    double x, y, z=0;
    
    while (choice != -9){
    cout << "\nWelcome to calculator, Press 1 to add" <<endl << "Press 2 to subtract" << endl << "Press 3 to multiply" <<endl;
    cout << "Press 4 to divide." << endl << "Press 5 to find the modulo. " <<endl<< "Press 6 to raise to a power"<<endl <<"Press -9 to quit" <<endl;
    cout <<"Make your choice: ";
    cin >> choice; 
    
    if (choice == -9){
        break;
    }
    cout << "\nEnter number 1: ";
    cin >> x;
    
    cout << "\nEnter number 2: ";
    cin >> y;
    
    
    if (choice ==1){
      z= x+y;
      cout << x << " +" << y << " =" <<z <<endl;
    }
    if (choice ==2){
      z= x-y;
      cout << x << " -" << y << " =" <<z <<endl;
    }    
    if (choice ==3){
      z= x*y;
      cout << x << " *" << y << " =" <<z <<endl;        
    }    
    if (choice ==4){
      z= x/y;
      cout << x << " /" << y << " =" <<z <<endl;
    }    
    if (choice ==5){
      z= (int (x))%(int (y));
      cout << x << " %" << y << " =" <<z <<endl;        
    }
    if (choice ==6){
      z= pow(x,y);
      cout << x << " ^" << y << " =" <<z <<endl;        
    }    
    
    }
 return 0;
}


/*
 Make a calculator that runs in a while loop, that we have the option of getting out of
 * 
 Add, subtract, divide, multiply, and raise to a power.
 * 
 * 
 */