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:
Example 2:
If A = 30°, B = 100°, and a = 20, then
Find the remaining angle:
C = 180 - 30 - 100 = 50°
Find the two remaining sides using the law of sines:
sinAa = sinBb
= sinCc
sin30°20 = sin100°b=
sin50°c
so b =
a⋅sin(B)sin(A)
= 20sin(100°)sin(30°) = 39.39
and c =
a⋅sin(C)sin(A)
= 20sin(50°)sin(30°) = 30.6
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
//variables
float aside, bside, cside;
float aangle,bangle,cangle;
//enter side a
while(1){
cout<<"enter the length of side a "<<endl;
cin>>aside;
if(aside > 0)
break;
}
//enter the angle
while(1){
cout<<"enter the first angle "<<endl;
cin>>aangle;
if( (aangle > 0) && (aangle < 180))
break;
}
while(1){
cout<<"enter the Second angle "<<endl;
cin>>bangle;
if( (bangle > 0) && (bangle < 180))
break;
}
cangle = 180 - aangle - bangle;
bside = (aside * sin(bangle)) / sin(aangle);
cside = (aside * sin(cangle)) / sin(aangle);
cout << "Side 1 "<< aside << endl;
cout << "Angle 1 "<< aangle << endl;
cout << "Side 2 "<< bside << endl;
cout << "Angle 2 "<< bangle << endl;
cout << "Side 3 "<< cside << endl;
cout << "Angle 3 "<< cangle << endl;
return 0;
}

Write a C++ program to analyze a variety of triangles. The program should determine all angles...
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...
The program should be in C
programming
The law of sines is an equation relating the lengths of the sides of an arbitrary triangle to the sines of its angles. Such that if we have the following triangle: sin a sin ß sin y A B C B Write a program that takes the values of angle a, angle B and length of A from a user. These input values are passed to a function find which calculates the angle...
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....
C code. Write a program to find all the triangles with integer side lengths and a user specified perimeter. Perimeter is the sum of all the sides of the triangle. Integers a, b and c form a triangle if the sum of the lengths of any two sides is greater than the third side. Your program should find all the triples a, b and c where a + b + c is user specified perimeter value. Print each triple only...
2. Write a program that prompts a user to enter the lengths of sides and angles for the two triangles described below. The program should calculate the length of the side of the triangle indicated below. Print the two answers to 3 decimal places onto the console screen Triangle 1 Read in the value of the angle, alpha, and the length, a, of the side indicated in the picture below. Calculate the length of the hypotenuse, c, of this right...
Program in C++ with sample shots.
Thank You.
(55 pts) Write a class Triangle that provides getSides, which returns the lengths of the three sides, and getAngles, which returns the degrees of the three internal angles. Then write a main function that randomly generates an array of triangles and finds the largest triangles first on the basis of area and then on the basis of perimeter
a.) Write a C++ program that calculates the value of the series
sin x and cos x, sin 2x or cos 2x where the user enters the value
of x (in degrees) and n the number of terms in the series. For
example, if n= 5, the program should calculate the sum of 5 terms
in the series for a given values of x. The program should use
switch statements to determine the choice sin x AND cos x, sin...
Two sides and an angle (SSA) of a triangle are given. Determine whether the given measurements produce one triangle, two triangles, or no triangle at all Solve each triangle that results. a=15, c=18, A=53° Select the correct choice below and, if necessary, to in the answer boxes to complete your choice (Round side lengths to the nearest tenth and angle measurements to the nearest degree as needed.) A. There is only one possible solution for the triangle The measurements for the remaining side b...
Consider the following C++ program. It prints a small table containing sin and cos values from 0 to 360 degrees. #include <iostream> #include <iomanip> #include <cmath> using namespace std; int main() { int step = 20; cout << setw(10) << "degrees" << setw(10) << "cos" << setw(10) << "sin" << endl; for (int degrees = 0; degrees <= 360; degrees += step) { cout << setw(10) << degrees << setw(10) << setprecision(5) << fixed << cos(degrees) << setw(10) << setprecision(5)...
#2, #3, #4. NOT #1. thank you!
1. Find the quadrant and reference angle associated with 2. For the given functions find without using a calculator: a. Quadrant in which the angle is located b. Reference angle c. The exact value of the trigonometric function a). sin(225) the rotation, sketch the diagram and find the associated point (x, y) on the unit circle. 11T 6 b). cos 3. Solve the oblique triangle with the given characteristics 4. a. Convert the...