EXERCISES 1. You are required to write a program to compute the area of square (area = side) OR a triangle (area = 1 x b
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
EXERCISES 1. You are required to write a program to compute the area of square (area = side) OR a triangle (area = 1 x b
EXERCISES 1. You are required to write a program to compute the area of square (area = side) OR a triangle (area = 1 x base x height). Using the program, a user will press character 'S' to determine the area of a square OR character 'T' to determine the area of a triangle. a) Illustrate the flow of the program by drawing a flowchart for the above problem. b) Develop the program using if-else statement c) Develop the program using switch-case statement d) Use your creativity to expand the program in (b) or (C) to implement nested if or nested switch statements. e) Explain the difference between if-else and switch statement in C. Note: You should consider both upper case and lower case as the input for the selection. An error message should be prompted for any invalid input selection.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!