Question: You are asked to write a C++ program which draws a house with a roof based on the following specifications. Application name: Display a welcome

You are asked to write a C++ program which draws a house with a roof based on the 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 integer). 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 still entering 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. 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 starts in the next row bye 2 and repeat this process until you reach to 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 widthof the house.

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!