1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
#include <iostream> using namespace std; int main(); class Menu{ public: void Start(){ cout << "Welcome to the calculator!\n" << endl; cout << "What would you like to calculate with? Addition (1), subtraction (2),\nmultiplication (3) or division (4)" << endl; cin >> answer; if(answer == 1){ cout << "You chose addition!" << endl; Addition additionObject; additionObject.beginCount(); } else if(answer == 2){ cout << "You chose subtraction!" << endl; Subtraction subtractionObject; subtractionObject.beginCount(); } else if(answer == 3){ cout << "You chose multiplication!" << endl; Multiplication multiplicationObject; multiplicationObject.beginCount(); } else if(answer == 4){ cout << "You chose division!" << endl; Division divisionObject; divisionObject.beginCount(); } else{ cout << "I do not understand, try again!\n\n"; main(); } } private: int answer; }; class Addition{ public: void beginCount(){ } }; class Subtraction{ public: void beginCount(){ } }; class Multiplication{ public: void beginCount(){ } }; class Division{ public: void beginCount(){ } }; int main() { Menu menuObject; menuObject.Start(); return 0; }