Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You are creating a console based math program. This program will be shown as a menu with several options. The menu should be created with

You are creating a console based math program. This program will be shown as a menu with several options. The menu should be created with a do loop. The first option is to display a list of even numbers beginning at 0. Once this option is selected, the program asks the user for the number of even numbers to display. After the user provides this input, all the values should be displayed at once. This option should be created using a "for" loop. The second option is to display a sequence of perfect squares. The program should begin by printing the square of 1, and ask the user if they to continue or stop and return to the original menu. If the user does not want to quit, the next square is printed. This continues until the user wishes to end the sequence. This option should be created using a while loop. The third option is to exit the program. Any invalid option entered by the user should prompt the menu to reappear and ask the same three options. Any numeric entry by the user should not crash if the user enters a string. Your program must: a. Use the appropriate loop for each segment. [3 marks] b. Encapsulate the logic of options 1 and 2 each within their own method. [4 marks] c. The functionality of the menu is correct as described. [3 marks] d. Proper error handling. [3 marks] e. Adhere to coding standards as described by the course. Marks will be taken off wherever coding standards are not followed.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions