Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You are required to write a C + + program that draws a specific geometric shape in the console, based on the digits of your

You are required to write a C++ program that draws a specific geometric shape in the console, based on the digits of your
student ID number.
Task Description
Your main task is to create a C++ application that:
Read your student ID from the keyboard.
Determine the type and dimensions of the shape to draw based on the digits in your ID.
Output the shape directly to the console.
Shape Rules
Based on the last digit of your student ID, your program should draw one of the following shapes:
If the last digit is either 0 or 1 : Rectangle
If the last digit is either 2 or 3 : Right triangle
If the last digit is either 4 or 5 : Isosceles triangle
If the last digit is either 6 or 7: Inverted right triangle
If the last digit is either 8 or 9: Diamond
The dimensions of the shapes should be determined by specific digits in your ID:
Rectangle: The height and width are determined by the first and second digits of your ID, respectively.
Triangles and Diamond: The height is determined by the first digit of your ID. For triangles, this is also the number of
lines; for the diamond, the total height is twice this number minus one.
Example Output
For a student ID of 123456789, the last digit is 9, and the output will be a diamond:
Submission Requirements
Submit the source code files and screenshot for your output based on your student ID.
Ensure your program compiles and runs without errors.
the ID is 202210664
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data, Mining, And Analytics Components Of Strategic Decision Making

Authors: Stephan Kudyba

1st Edition

1466568704, 9781466568709

More Books

Students also viewed these Databases questions

Question

3. How would you address the problems that make up the situation?

Answered: 1 week ago

Question

2. What recommendations will you make to the city council?

Answered: 1 week ago