Write pseudocode to print your Name and Matric ID. Then, request a user to invoke
(a) Write pseudocode to print your Name and Matric ID. Then, request a user to invoke
selection number 1 to print the menu and triangle as shown in Figure Q4.
(6 marks)
(b) Write the C program that can print your Name, Matric ID and the triangle design.
Using a while loop, the program allows the user to repeat the process by invoking
letter ‘y’ and the process will be terminated when the user invokes any letter, except
letter ‘y’. The program consists of the following functions:
Main – call the other function to print messages. Then, prompt and ask user
to invoke number 1 to call other functions to print a triangle. Afterward,
prompt and ask user to invoke letter ‘y’ to repeat the process as shown in
Figure Q4.
print_menu – print messages including your Name and Matric ID as shown
in Figure Q4.
draw_triangle – print a triangle.


Trending now
This is a popular solution!
Step by step
Solved in 2 steps









