You are required to write a C++ program to do the following: Ask the user to enter the length and width of a rectangle and read them. Ask the user to enter a displacement number indicating the position of the rectangle from the left side of the screen and read it. Ask the user to enter a fill character that will be used to fill the rectangle and read it. Display the rectangle according to the entered specification. A sample execution of the program is shown below: Enther the length and width of rectangle: 4 8 Enter the rectangle displacement: 10 Enter the fill character: * ******** ******** ******** ******** Press any key to continue Enther the length and width of rectangle: 5 5 Enter the rectangle displacement: 20 Enter the fill character: 0 00000 00000 00000 00000 00000 Press any key to continue - .

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter9: Completing The Basics
Section9.5: Input Data Validation
Problem 1E
icon
Related questions
Question
100%

Problem 23 - Looping Statements

C++ program pls

You are required to write a C++ program to do the following:
Ask the user to enter the length and width of a rectangle and read them.
Ask the user to enter a displacement number indicating the position of the rectangle from the left side of
the screen and read it.
Ask the user to enter a fill character that will be used to fill the rectangle and read it.
Display the rectangle according to the entered specification.
A sample execution of the program is shown below:
Enther the length and width of rectangle: 4 8
Enter the rectangle displacement: 10
Enter the fill character: *
Press any key to continue
Enther the length and width of rectangle: 5 5
Enter the rectangle displacement: 20
Enter the fill character: 0
00000
00000
00000
00000
00000
Press any key to continue
Transcribed Image Text:You are required to write a C++ program to do the following: Ask the user to enter the length and width of a rectangle and read them. Ask the user to enter a displacement number indicating the position of the rectangle from the left side of the screen and read it. Ask the user to enter a fill character that will be used to fill the rectangle and read it. Display the rectangle according to the entered specification. A sample execution of the program is shown below: Enther the length and width of rectangle: 4 8 Enter the rectangle displacement: 10 Enter the fill character: * Press any key to continue Enther the length and width of rectangle: 5 5 Enter the rectangle displacement: 20 Enter the fill character: 0 00000 00000 00000 00000 00000 Press any key to continue
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Fundamentals of Boolean Algebra and Digital Logics
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning