Question: You are asked to write a C++ program that draws a house with a roof based of following specifications. Application name: Display a welcome banner

 You are asked to write a C++ program that draws a

house with a roof based of following specifications. Application name: Display a

welcome banner 1) Welcome user: Ask the user for their name and

using their name welcome them to your application. 2) Request house dimensions

You are asked to write a C++ program that draws a house with a roof based of following specifications. Application name: Display a welcome banner 1) Welcome user: Ask the user for their name and using their name welcome them to your application. 2) Request house dimensions and validate input: Ask the user to enter the width and height of the house to be drawn (Note: Both height and width are integers). The width must be even and bigger than 2. If the user enters odd numbers or a number less than or equal to 2 for the width, you are required to prompt the user until they enter an even number. They have 3 tries for entering width. If after 3 tries they are stillentering odd numbers terminate your program with an appropriate personalized message otherwise move on to step 3. 3) Draw the house a. Draw the roof: i. The roof consists of a set of stars on each row. The number of stars in the last row of the roof is equal to the width of the house. The first row starts with two stars and you increase the number of stars in the next row by 2 and repeat this process until you reach the width. For example, if the width is 6 , the roof shape will be like this (2,4 and 6 stars): Hint: The number of rows needed to print/draw the roof is half the width of the house. Note: There is no space between the stars in each row. b. Draw the body of the house: i. The body of the house has height +1 rows in all. ii. Last row is drawn using the dash character (). There are width dashes. iii. The walls are represented by height rows. Each of the rows are made up of 2 characters of / on the left and right sides and the rest are spaces. c. Keep track of the number of houses you have drawn. Again? Ask the user if they wish you to draw another house. If yes repeat the steps 3. If no, move on to step 5. End program: display this message: "Hope you like your house(s)" are a few sample outputs: user input is highlighted in grey What is your name? Anna Nell Anna, welcome to the house drawing program. Do you want me to draw a simple house for you? (yeso) yes Enter height of the house you want me to draw: 3 Please enter an even number for the width of the house (must be even numbers and bigger than 2 ): 3 You enter 3 for the width. Not an even number! Please enter an even number for the width of the house (must be even numbers and bigger than 2 ): 5 You enter 5 for the width. Not an even number! Please enter an even number for the width of the house (must be even numbers and bigger than 1): 11 You enter 11 for the width. Not an even number! it seems you are having troubles entering even numbers! Program ends now. Do you want me to draw a simple house for you? (yeso) yes Enter the height of the house you want me to draw: 5 Please enter an even number for the width of the house (must be even numbers and bigger than 2): 10 ** Do you want me to draw a simple house for you? (yeso) no Hope you like your 2 houses

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!