Question
Write a script that asks a user for the length of two sides of a triangle and the angle between them to calculate the area.
Write a script that asks a user for the length of two sides of a triangle and the angle between them to calculate the area. A message should be displayed presenting the calculation results. The user must also specify if the angle entered is in radians(r) or degrees(d) so that the appropriate calculation can be executed. If the user enters an incorrect choice, an error message should be shown. Specifications: You must create 2 functions: areadeg, which applies if the user chooses degrees, and arearad, when the user chooses radians. The functions must receive the necessary data from the script, and must return the result of the area calculation to the script. The script is your main program. The input data request must be coded in the script. The conditional statement to evaluate the user choice of radians or degrees must also be coded in the script. The area functions must be called (executed) from the script according to the user choice. The result must be displayed from the script. You must use fprintf() to display the triangular area result, formatted to 2 decimal places. matlab
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started