HAND TRACING
Accept the two sides and an angle included by these two sides, and find the area and third side of a triangle.
(1) Display "Enter two sides and an angle:"
(2) Accept a, b,theta
(3) ang = theta * 3.14 / 180;
(4) third_side = sqrt (a*a + b*b - 2*a*b* cos(ang))
(5) area = ½*a*b* sin(ang)
(6) Display "Third_side =",third_side,"Area =", area
(7) Exit
Start
Declare variables a, b,theta,ang
Display "Enter two sides and an angle:"
Read a
Read b
Read theta
Set ang = theta * 3.14 / 180;
Set third_side = sqrt (a*a + b*b - 2*a*b* cos(ang))
Set area = 1/2*a*b* sin(ang)
Display "Third_side =",third_side,"Area =", area
Stop
Comments
Leave a comment