Write a program to compute the area of a triangle using side-angle-side method and reports the area of that triangle (rounded to 2 decimal places).
Side-angle-side formula: ???? = 1/ 2 ?? sin(?), where a and b are two sides of the triangle, and C is the included angle.
Your program must meet the following criteria to receive full marks:
• Randomly generate two values between 5 and 10 (inclusive) for two sides a and b of the triangle, respectively. You must use random module for this (see https://docs.python.org/3/library/random.html?highlight=random#module-random).
• Ask the user for the angle C in degrees (assume user always gives correct input for this one, i.e., a number between 0 and 180, inclusive).
• Python functions require angles in radians. So first convert the degrees value C to radians. You must use Python math module for this (see https://docs.python.org/3/library/math.html).
• Compute the area of the triangle and print the results as follows. You need to use Python math module here (https://docs.python.org/3/library/math.html#trigonometric-functions).
Sample output:
Enter a value for the angle (between 0 to 180): 45
The area of the triangle with a = 7, b = 6 and c = 45 degrees is 14.85
# do comment if any problem arises
# Code
import random
import math
# generate random values for a and b
a=random.randint(5,10)
b=random.randint(5,10)
# read angle from user
c_degrees=int(input("Enter a value for the angle(between 0 to 180): "))
# convert to radians
c_radian=math.radians(c_degrees)
# calculate area
area=1/2*a*b*math.sin(c_radian)
# round to 2 decimal places
area=round(area,2)
print(f'The area of the triangle with a = {a},b = {b} and c = {c_degrees} degrees is {area}')
Screenshot:

Output:

Write a program to compute the area of a triangle using side-angle-side method and reports the...
Write a C++ program to analyze a variety of triangles. The program should determine all angles and all sides for a triangle for three different options (give the user a menu of choices): 1) Given two sides and the angle between 2) Given two angles and one side 3) Given three sides More details for each option is provided below. Option 1: Given two sides and the angle between First check to be sure that the three values entered are...
Write a C++ program to analyze a variety of triangles. The program should determine all angles and all sides for a triangle for three different options (give the user a menu of choices): Given two angles and one side First check to be sure that the three values entered are valid. In particular, the following conditions must be met: Side > 0 For each angle: 0 < angle < 180 (if angle is in radians, convert it to degrees first...
Problem a (PA4a.java) Write a program to evaluate the area of a triangle given the lengths of its sides using Heron's Formula. Here is an outline: Get the three side lengths from the user (which might have decimal values): a, b, c. Check to ensure that the sides are valid for a triangle. Importantly, the sum of the lengths of any two sides must be larger than the length of the third side (you must check all three sides this...
3. Write a program to calculate the area of a triangle. Your program will take the length of two sides and the included angle (in degrees), then prints the area based on the following formula. A = 1/2 ab sin C
/4 Question An area of square, drea ofa rectangle and triangle can be calculated by using the given formula: sqareaa (renww value from the functioi area is reciabgle-(retrn valwe from the function is area int) ceouatre -D-(return value fromtheneion e s double t and s s formula must be use when the values for the sides of the triangle are whether you want to calculate the area of square or a. b and c are the sides of the triangle...
This question is from the textbook "Python for ArcGIS" by Laura Tateosian: Write a script "triangles.py" that takes three arguments, the lengths of three sides of a triangle. Then define the following three functions: 1. perimeter takes three side lengths as arguments and returns the perimeter length. 2. triangleType takes three side lengths as arguments, determines if it is an equilateral triangle, an isosceles triangle, or neither. The result is returned. 3. area takes three side lengths as arguments and...
MATLAB question
Triangle Calculations (script with two anon functions) 0 solutions submitted (max: Unlimited) Consider a general triangle with side lengths a, b, and c and angles A, B, and C as shown below Write a script that does the following Define the following two anonymous functions and assign to the indicated Function Handles: 1. The function ThirdSide should accept the lengths of sides a and b as well as angle C in that order and use the Law of...
Use Python WingPersonal to compile and also please give output Math and String operations Write a script to perform various basic math and string operations. Use some functions from Python's math module. Generate formatted output. Basic math and string operations Calculate and print the final value of each variable. a equals 3 to the power of 2.5 b equals 2 b equals b + 3 (use +=) c equals 12 c = c divided by 4 (use /=) d equals...
The "for more practice part" using matlab
If the lengths of two sides of a triangle and the angle between them are known, the length of the third side can be calculated. Given the lengths of two sides (b and c) of a triangle, and the angle between them alpha in degrees, the third side a is calculated as follows a^2 = b^2 + c^2 - 2b c cos(alpha) White a script thirdside that will prompt the user and read...
Use Python Write a script to perform various basic math and string operations. Use some functions from Python's math module. Generate formatted output. Basic math and string operations Calculate and print the final value of each variable. a equals 3 to the power of 2.5 b equals 2 b equals b + 3 (use +=) c equals 12 c = c divided by 4 (use /=) d equals the remainder of 5 divided by 3 Built-in functions abs, round, and...