Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int NumberOne = 0;
- int NumberTwo = 0;
- char Maths = ' ';
- int Sum = 0;
- //Start!
- cout << "Enter 'A' for Addition, 'S' for Subtraction, 'M' for Multiplication and 'D' for Division.: ";
- cin >> Maths;
- Maths = toupper(Maths);
- if (Maths == 'A'){
- cout << "Please enter the number you wish to add: ";
- cin >> NumberOne;
- cout << "Please enter the second number: ";
- cin >> NumberTwo;
- Sum = NumberOne + NumberTwo;
- }else if (Maths == 'S'){
- cout << "Please input the base number: ";
- cin >> NumberOne;
- cout << "Please input the number to be Subtracted: ";
- cin >> NumberTwo;
- Sum = NumberOne - NumberTwo;
- }else if (Maths == 'M'){
- cout << "Please Inscribe the number to Multiply by: ";
- cin >> NumberOne;
- cout << "Please Inscribe the number to be Multiplied: ";
- cin >> NumberTwo;
- Sum = NumberOne * NumberTwo;
- }else if (Maths == 'D'){
- cout << "Please Engrave the number to be Divided: ";
- cin >> NumberOne;
- cout << "Please Engrave the Divisor: ";
- cin >> NumberTwo;
- Sum = NumberOne / NumberTwo;
- }else if (Maths != 'A' && Maths != 'S' && Maths != 'M' && Maths != 'D')
- cout << "Invalid Entry. Please input 'A' 'S' 'M' or 'D'";
- // There was code here untill the Shoggoth ate it.
- else
- {cout << "Sum: " << Sum << endl;}
- system("pause");
- return 0;
- } //end of main function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement