Question: C++ PROGRAM PLEASE 1) Menu Write a program that displays a menu similar to one given below. The menu asks the user to choose 1,

C++ PROGRAM PLEASE

C++ PROGRAM PLEASE 1) Menu Write a program that displays a menu

1) Menu Write a program that displays a menu similar to one given below. The menu asks the user to choose 1, 2, 3, 4, or for addition, subtraction, multiplication, division, or to quit respectively. If the user enters 1, 2, 3, or 4 the program asks for two numbers and preforms and prints the result of the operation. Sample input/output: Menu For addition enter 1: For subtraction enter 2: For multiplication enter 3: For division enter 4: To quit enter 0: What is your choice? 3 Enter the two numbers: 28 2*8 = 16 2) A Palindrome Write a program that prompts the user to enter a four-digit positive integer, then it checks whether the number is a palindrome or not. A number is a palindrome if it reads the same whether it read left to right or right to left. For example, the number 2662 is a palindrome, while the number 2635 is not a palindrome. Sample input/output: Enter five-digit positive integer: 26762 26762 is a Palindrome 3) Pages in a Book: Write a program that prompts the user to enter a positive integer m that represents the sum of all page numbers in a book. The program prints whether the number is a valid sum or not. For example, the integer 21 is a valid sum of page numbers because 1 + 2 +3 +4 +5 +6 = 21. The integer 25 is not a valid sum because the sum of the first 6 page numbers is 21 and the next page number is 7. so the sum of the first 7 page numbers should be 28. Ifm is a valid sum of all page numbers, then there must be an integer n such that 1+2+3+ ... +n=n(n+1)/2 = m Sample inputs / outputs: Enter the sum of pages: 4005 4005 is a valid sum of page numbers

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!