Question: Modify Lab 5 Program.cpp to create a program that asks the user for a positive integer value. The program will output a rectangle with that

 Modify Lab 5 Program.cpp to create a program that asks the
user for a positive integer value. The program will output a rectangle
with that many rows. You will also ask the user for another
integer number. Row numbers that are evenly divisible by this number should

Modify Lab 5 Program.cpp to create a program that asks the user for a positive integer value. The program will output a rectangle with that many rows. You will also ask the user for another integer number. Row numbers that are evenly divisible by this number should be printed with a *. All other rows will print with a #. The program should use a for loop to print the ASCII art. Each row will have 10 characters. Your output needs to be formatted as shown below. Your program should only accept numbers 1 - 25. In other words, you cannot print more than 25 rows and the multiple should also be in this range. Sample run 1: Enter the number of rows you would like to print (1-25): 12 Enter the multiple: 2 ########## ########## ******** ########## ########## ########## ########## Sample run 2: Enter the number of rows you would like to print (1-25): 7 Enter the multiple: 3 ########## ########## ########## ########## ***** ########## Sample run 3: Enter the number of rows you would like to print (1-25): 30 Enter the multiple: 2 ERROR: number of rows and multiple should be in the range 1-25 Attach your modified .cpp file as your submission to this question. #include using namespace std; int main() { int rows, multiple; // Prompt the user for the number of rows and the multiple: cout > rows; cout > multiple; // TODO: Validate input, then print the sequence: return 0; }

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!