Write a C# program that will obtain the size and type of shape to draw on the console screen. Your program will complete the following:

  • Input the shape size as an integer. Check for the value being invalid, too low (must be 5 or larger) or too high (must be less than or equal to 25). See the example shown below; separate error messages are required for each type of error and use a loop to handle the errors.
  • Input the type of shape as a string. Acceptable values are "line", square, or triangle in lower case. Any other string will display an error message. Use a loop to force the user to enter a correct shape.
  • Draw the shape using for loops with the * character as shown in the examples below.
  • The program will be repeated until the user elects to end the program after a shape has been drawn.

Your program must be fully documented to be accepted by your instructor. Use the best loop construct for each programming situation. You are not allowed to use the break statement except within a switch statement. Verbose variable names are required.

Some sample executions are shown: see image.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.