Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Project 8 Multiplication Table Generator HINT: Read this document meticulously so that you understand what is required BEFORE you begin the logical design. Based upon

Project 8 Multiplication Table Generator HINT: Read this document meticulously so that you understand what is required BEFORE you begin the logical design. Based upon user input, this program generates dynamic multiplication tables. This program uses a series of do loops and for loops to accomplish this task. Code a C++ program based upon the following constraints:

1. Inside of main, make the following variable and constant declarations:

const int START_NUM_MAX = 2;

const int END_NUM_MAX = 10;

int numStart = 0; //user start value

int numEnd = 0; //user end value

int z = START_NUM_MAX; //y axis row counter

char quitFlag = 'N';

bool errFlag = false;

2. Place all of your logic inside of a do loop which will continue executing until the user is ready to quit.

3. Using the system object, clear the screen on each pass of the outer most loop. (You will need to research this.) Display the title on every pass for each new table.

4. Get and validate the numStart value using a post-test do loop. The numStart value must be >= START_NUM_MAX and <= END_NUM_MAX. Your code will continue looping and prompting until it is valid. Instead of duplicating error prompts for the various error states, you will set errFlag variable to true for any error condition, test this at the bottom of the loop body, and display one error message at the bottom of the loop body if needed. When your program gets a valid value, exit the loop. P a g e | 2

5. Get and validate the numEnd value using a post-test do loop. The numEnd value must be >= numStart and <= END_NUM_MAX. Your code will continue looping and prompting until it is valid. Instead of duplicating error prompts for the various error states, you will set errFlag variable to true for any error condition, test this at the bottom of the loop body, and display one error message at the bottom of the loop body if needed. When your program gets a valid value, exit the loop.

6. Once all values are validated, you will begin to build and output the table. The first step is to build the column header. You will use a for loop for this work. Additionally, you will need to use the tab escape character to place tabs between items. (Do NOT use spaces - you will need to research this.)

7. To build the table rows and columns, you will use a nested for loop. (Use row major order. If you dont know what this means research it.)

8. Once your program generates the table, it will prompt the user for another table. Use a do loop driven by a variable entitled quitFlag for this. Additionally you will need to handle the uppercase vs. lower case issue here. (Research the toupper() and tolower() functions to achieve this do NOT use multiple conditional statements). If the user enters a n or a N your program will exit, displaying a goodbye message. If the user enters any characters other than these, the program will continue prompting until a valid character is obtained. If the user enters a y or a Y, your program will clear the screen and prompt for new values discussed in step #3 above.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

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

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions