Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.  
  7.  
  8. int NumberOne = 0;
  9. int NumberTwo = 0;
  10. char Maths = ' ';
  11. int Sum = 0;
  12.  
  13.  
  14.  
  15. //Start!
  16. cout << "Enter 'A' for Addition, 'S' for Subtraction, 'M' for Multiplication and 'D' for Division.: ";
  17. cin >> Maths;
  18. Maths = toupper(Maths);
  19.  
  20. if (Maths == 'A'){
  21. cout << "Please enter the number you wish to add: ";
  22. cin >> NumberOne;
  23. cout << "Please enter the second number: ";
  24. cin >> NumberTwo;
  25. Sum = NumberOne + NumberTwo;
  26. }else if (Maths == 'S'){
  27. cout << "Please input the base number: ";
  28. cin >> NumberOne;
  29. cout << "Please input the number to be Subtracted: ";
  30. cin >> NumberTwo;
  31. Sum = NumberOne - NumberTwo;
  32. }else if (Maths == 'M'){
  33. cout << "Please Inscribe the number to Multiply by: ";
  34. cin >> NumberOne;
  35. cout << "Please Inscribe the number to be Multiplied: ";
  36. cin >> NumberTwo;
  37. Sum = NumberOne * NumberTwo;
  38. }else if (Maths == 'D'){
  39. cout << "Please Engrave the number to be Divided: ";
  40. cin >> NumberOne;
  41. cout << "Please Engrave the Divisor: ";
  42. cin >> NumberTwo;
  43. Sum = NumberOne / NumberTwo;
  44. }else if (Maths != 'A' && Maths != 'S' && Maths != 'M' && Maths != 'D')
  45. cout << "Invalid Entry. Please input 'A' 'S' 'M' or 'D'";
  46. // There was code here untill the Shoggoth ate it.
  47. else
  48. {cout << "Sum: " << Sum << endl;}
  49.  
  50. system("pause");
  51. return 0;
  52. } //end of main function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement