Question: C++ 4 Triangles Write a program to display 4 different right triangles. Ask the user for: The size of the base of the triangles o

C++

4 Triangles

Write a program to display 4 different right triangles. Ask the user for: The size of the base of the triangles o Validate using a loop that the number is between 1 and 15 inclusive The character used to create the triangles Use nested for loops to create the triangles (Hint: the last 2 triangles either require 2 inner loops 1 for the spaces and 1 for the characters, or a decision to determine if a space or a character should be displayed)

C++ 4 Triangles Write a program to display 4 different right triangles.

Example Run: (bold type is what is entered by the user) Enter the size of the base for the triangles (1-15): 20 The base of the triangles must be between 1 and 15 Please re-enter Enter the size of the base for the triangles (1-15): 4 Enter a character to use to draw the triangles Pattern A Base at bottom Hypotenuse on right Pattern B Base at top Hypotenuse on right. Pattern C Base at top Hypotenuse on left Pattern D Base at bottom Hypotenuse on left The example run shows EXACTLY how your program in put and output will look

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!