#include "stdafx.h" #include #include using namespace std; int main() { // Ask user for the "opposite" and "adjacent" sides of a triangle. cout << "Please enter the 'opposite' length of a triangle: "; double opposite; cin >> opposite; cout << "Thanks. Now enter the 'adjacent' length of a triangle: "; double adjacent; cin >> adjacent; // Calculate and display the area and hypotenuse. double area = opposite * adjacent / 2; double hypotenuse = sqrt((opposite * opposite) + (adjacent * adjacent)); cout << endl << "Area of triangle: " << area << endl; cout << "Hypotenuse: " << hypotenuse << endl; // Calculate and display the angles. We'll assume a right-angle triangle, so one angle is definitely 90 degrees. double angle1 = 90; double angle2 = asin(opposite / hypotenuse) * 360 / (2 * 3.14); double angle3 = 90 - angle2; cout << endl << "Angle 1 (radians): " << angle1 << endl; cout << "Angle 2 (radians): " << angle2 << endl; cout << "Angle 3 (radians): " << angle3 << endl; return 0; }