Part 1 of the problem

Marcus wants to create a program that helps his kids learn some basic number manipulations. He started the program but got frustrated and asked you to help him out. Here is what he has so far:

#include
using namespace std;

int main()
{
int menu_choice;
int number;

cout << "Enter number: ";
cin >> number;

cout << "1) Is the number odd or even? /n"
<< "2) Is the number positive or negative? /n";
<< "3) What is the square root of the number? /n/n;

cout << "Enter a menu choice: ";
cin >> menu_choice;

if (menu_choice = 1)
// Process
// Display odd, even, or zero
if (menu_choice == 2)
// Process
// Display positive, negative or zero
if (menu_choice == 3);
// Process
// Display square foot


return 0;

}

As you can see, He didn’t get very far before he gave up. To help him out, convert Marcus’s if statements to a more efficient switch statement. Also, complete the necessary number manipulations. Remember, even though that you are jumping into the middle of a program that is already written (well, almost), don’t forget the development process.

Part 2 of the problem

Marcus would like you to expand what you did to include the following functionality.

  • The children got tired of having to rerun the program each time to try another menu item. Add a loop to the program that continues until an Exit menu option has been chosen.
  • Marcus noticed that if his children accidently entered a wrong number for the menu choice they were a little confused when the program abruptly ended. Add functionality to the switch statement that checks the menu choice and displays an error message if an incorrect value is entered.
  • Add a few additional menu options

How many digits are in a number? HINT: Repeatedly divide the number by 10, keeping track of the number of times you divide.

What digit is at a specific position?

Display an addition table for all numbers up to 12.

Display a multiplication table for all numbers up to 12.

Include your pseudocode.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.