Question: C++ Write a short program which will continually prompt a user to enter two coordinates, an x coordinate and a y coordinate. These will be

 C++ Write a short program which will continually prompt a user

C++

Write a short program which will continually prompt a user to enter two coordinates, an x coordinate and a y coordinate. These will be of the type short integer. Validate that each of these are both numeric and within the range of 5-27. Further, make sure that the x coordinate is always less than the y. After validating these entries, allow the user to choose a character of '%', '#' or '@'. This will be the display character. You may use ENUMS for this if you wish to. Validate the user enters one of those three choices. Now display the character of choice as the border of a rectangle that is shaped by using the x and y values for the row and the column, as follows: ######## # ######## This is what the screen would look like if the user chose 5 and 8 for x and y respectively, and the # as the character to display. Notice it forms a rectangle by drawing the border of the rectangle using the character of choice. Finally, ask the user whether they wish to repeat again, and of course if they do repeat the process. Summary - take x and y coordinates from the user, validating them as numeric and within a range and with x always less than y. Take a char that is one of three symbols, validate that it indeed is, and then display a rectangle (border only) using the items collected from the user. Repeat this entire process if the user desires to (aka user driven repeating program)

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!