Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started