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

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter6: Arrays
Section: Chapter Questions
Problem 7RQ
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
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
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