Question: Using C++ make a program that will Draw a w-wide h-high rectangular frame, using asterisks. Ex (w=5, h=4): ***** * * * * ***** Draw
Using C++ make a program that will
Draw a w-wide h-high rectangular frame, using asterisks. Ex (w=5, h=4): ***** * * * * *****
Draw the lower triangular part of a square, given the side length. Ex (side=5): * ** *** **** *****
Similar to 2, but draw the trapezoid with the bottom height elements of the triangle. Ex (side=5, height=3): *** **** *****
Similar to 2, but draw the upper triangular part of the square (i.e., the other half of the square).
Given a radius, draw a circle with that radius. Hint: Recall that a circle of radius r is defined as the set of points (x,y) where x2+y2
Although we used character graphics in this lab, the same approaches can be used with individual pixels (or squinting hard enough at the asterisks).
Input
For each part of the problem, your program should input all parameters from the keyboard (after prompting the user).
Moreover, the program should ensure that inputs are legal for the shape in question. Do not worry about the case where the parameters are too big to be displayed properly in the terminal.
Your program should contain a menu that asks the user to choose an which shape they want to draw. E.g.: Choose a shape: 1. Frame 2. Lower Triangle 3. Trapezoid 4. Upper Triangle 5. Circle
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
