Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ 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

C++
image text in transcribed
image text in transcribed
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 ######### ###### HERRER ########## . ########## *** ########## ########## Sample run 2: Enter the number of rows you would like to print (1-25): 7 Enter the multiple: 3 ########## ########## ########## W/Description: this program will print a pattern of user-input length ***This is the line of 80 characters in length*** #Your code should not exceed the length of the above line #include using namespace std; sint main() int rows, multiple; W/ Prompt the user for the number of rows and the multiple: cout > rows; cout > multiple: Y TODO: Validate input, then print the sequence: 5 6 7 8 return 0

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

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

Recommended Textbook for

PostgreSQL Up And Running A Practical Guide To The Advanced Open Source Database

Authors: Regina Obe, Leo Hsu

3rd Edition

1491963417, 978-1491963418

More Books

Students also viewed these Databases questions