Q3. Write a C program that displays the menu shown in the example run, to the user, with the operations following the menu selection. • The menu will be shown continuously until such time that the user inputs 3 for exit. • If anything but the exit (the 3rd) option is chosen, then the program will generate a random number between 3 and 9, and then use this number to determine how many rows of the triangle of choice to draw. • If right triangle is chosen, then draw a triangle aligned to the right hand side, as shown in example run. • If isosceles triangle is chosen, then draw a triangle as shown in the example run below. Project Name: LG9_Q3 File Name: Q3.cp

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter6: Modularity Using Functions
Section6.4: A Case Study: Rectangular To Polar Coordinate Conversion
Problem 7E: (Simulation) Write a program to simulate the roll of two dice. If the total of the two dice is 7 or...
icon
Related questions
Question
Can you help me with this question ?
Number is 6 digits
Q3. Write a C program that displays the menu shown in the example run, to the user, with the operations following the menu
selection.
• The menu will be shown continuously until such time that the user inputs 3 for exit.
If anything but the exit (the 3rd) option is chosen, then the program will generate a random number between 3 and 9,
and then use this number to determine how many rows of the triangle of choice to draw.
• If right triangle is chosen, then draw a triangle aligned to the right hand side, as shown in example run.
• If isosceles triangle is chosen, then draw a triangle as shown in the example run below.
Project Name: LG9 Q3
File Name: Q3.cpp
Example Run:
212
MENU
MENU
1. Right Triangle
2. Isosceles Triangle
3. Exit
Enter your choice: 1
Random number is 5
1. Right Triangle
2. Isosceles Triangle
3. Exit
Enter your choice: 2
Random number is 7
1
212
21
32123
321
4321234
543212345
4321
54321
65432123456
7654321234567
MENU
MENU
1. Right Triangle
2. Isosceles Triangle
3. Exit
Enter your choice: 2
Random number is 2
1. Right Triangle
2. Isosceles Triangle
3. Exit
Enter your choice:3
LG8 Q1a - --
XQ1A_sols
LahGuide9.
LG9_Sols -
Transcribed Image Text:Number is 6 digits Q3. Write a C program that displays the menu shown in the example run, to the user, with the operations following the menu selection. • The menu will be shown continuously until such time that the user inputs 3 for exit. If anything but the exit (the 3rd) option is chosen, then the program will generate a random number between 3 and 9, and then use this number to determine how many rows of the triangle of choice to draw. • If right triangle is chosen, then draw a triangle aligned to the right hand side, as shown in example run. • If isosceles triangle is chosen, then draw a triangle as shown in the example run below. Project Name: LG9 Q3 File Name: Q3.cpp Example Run: 212 MENU MENU 1. Right Triangle 2. Isosceles Triangle 3. Exit Enter your choice: 1 Random number is 5 1. Right Triangle 2. Isosceles Triangle 3. Exit Enter your choice: 2 Random number is 7 1 212 21 32123 321 4321234 543212345 4321 54321 65432123456 7654321234567 MENU MENU 1. Right Triangle 2. Isosceles Triangle 3. Exit Enter your choice: 2 Random number is 2 1. Right Triangle 2. Isosceles Triangle 3. Exit Enter your choice:3 LG8 Q1a - -- XQ1A_sols LahGuide9. LG9_Sols -
Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Random Class and its operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT