EXERCISES 1. You are required to write a program to compute the area of square (area = side) OR a triangle (area = 1 x b
Posted: Tue Apr 12, 2022 10:14 am
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.