Question: C++ program ASSIGNMENT: Output(visual): This is what I have so far. HTML (HyperText Markup Language) is used to describe the structure of a web page

C++ program

C++ program ASSIGNMENT: Output(visual): This is what I have so far. HTML

ASSIGNMENT:

(HyperText Markup Language) is used to describe the structure of a web

page that you view in any internet browser. It uses a series

Output(visual):

of start and end tags to specify page elements. For example, the

This is what I have so far.

following HTML would create a table with 2 rows and 3 columns:

HTML (HyperText Markup Language) is used to describe the structure of a web page that you view in any internet browser. It uses a series of start and end tags to specify page elements. For example, the following HTML would create a table with 2 rows and 3 columns:

A B C
D E F

The

tag signifies the beginning of a table, and

is the end of the table. The beginning and end of a row is specified with

and

, while each individual cell within the table are specified with

and

. Any text that is placed in-between

and

will be displayed within that table cell. The previous example would create an HTML page that looks like the following when viewed in a web browser: ABC DEE Your assignment is to generate an HTML multiplication table with dimensions specified by the user. You will ask the user for the number of rows then number of columns, and generate an HTML table of the appropriate size. The top left cell should contain the result of 1 x 1, and the bottom right cell should contain the result of num_rows x num_cols. Each row and column may be an integer value between 1 and 12 inclusive (1 or 12 are valid). If the user does not specify a value in this range or a value that is not a valid integer, prompt the user again until you receive a valid value. You should not simply exit the program if invalid input is given. Add an extra row and column at the top and far left which contains row and column headers for your multiplication table. The top left cell should contain X to signify that it is a multiplication table. See the example output below: Enter a number of rows (1-12): 2 Enter a number of columns (1-12): 3

X 1 2 3
1 1 2 3
2 2 4 6

Enter a number of rows (1-12): 2 Enter a number of columns (1-12): 3

1 2 3
2 4 6

Enter a number of rows (1-12): 1 Enter a number of columns (1-12): 4

1 2 3 4

Enter a number of rows (1-12): 0 Enter a number of rows (1-12): 13 Enter a number of rows (1-12): ten Enter a number of rows (1-12): 2abc Enter a number of columns (1-12): Enter a number of columns (1-12): -5 Enter a number of columns (1-12): a10 Enter a number of columns (1-12): 2a

1 2
2 4

#include #include using namespace std; int getInput(string prompt) { int value = 0; ://looping until user enter valid value while(value 12){ cout > value; ....//checking if value is not an integer, or value is not in range if(cin.fail() || value 12) { //removes any stray input cin.clear(); cin.sync(); //error message cout

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!