Lab 2-11
Lab 2-11
➢ Let the user input one of the following characters: R for Rectangular, S for Square, C
for Circle, and T for Triangle
➢ If the user enters “r”, let the user enter the length and the width to compute the area
using the following equation: 𝒂𝒓𝒆𝒂 = 𝒍𝒆𝒏𝒈𝒕𝒉 ∗ 𝒘𝒊𝒅𝒕𝒉
➢ If the user’s choice is “s”, let the user enter the length and the width to compute the
area using the following equation: 𝒂𝒓𝒆𝒂 = 𝒍𝒆𝒏𝒈𝒕𝒉 ∗ 𝒍𝒆𝒏𝒈𝒕𝒉
➢ If the user enters “c”, let the user enter the length and the width to compute the area
using the following equation: 𝒂𝒓𝒆𝒂 = 𝟑. 𝟏𝟒 ∗ 𝒓𝒂𝒅𝒊𝒖𝒔 ∗ 𝒓𝒂𝒅𝒊𝒖𝒔
➢ If the user enters “t”, let the user enter the length and the width to compute the area
using the following equation: 𝒂𝒓𝒆𝒂 = 𝟎. 𝟓 ∗ 𝒃𝒂𝒔𝒆 ∗ 𝒉𝒆𝒊𝒈𝒉
➢ If the user enters an incorrect choice, a warning message is displayed as follows: “The
entered character is incorrect!!”
Sample Output: