Question: 1 . Write a C + + program that does the following: a . Create a C + + file with the name problem 2

1. Write a C++ program that does the following:
a. Create a C++ file with the name problem2.cpp.
b. Prompt the user to enter three angle values in degrees.
c. Checks and prints whether the three given angles form a triangle. If the three angles add up to 180, then they form a triangle.
d. If the three given angles form a triangle, then the program determines and prints whether the triangle is equilateral, right, or neither.
e. An equilateral triangle has three 60-degree angles.
f. A right triangle has one 90-degree angle.
Sample run of the program:
Enter an angle in degrees: 45
Enter an angle in degrees: 45
Enter an angle in degrees: 90
Can form a triangle from these angles.
The triangle is a right triangle.
Sample run of the program:
Enter an angle in degrees: 50
Enter an angle in degrees: 70
Enter an angle in degrees: 60
Can form a triangle from these angles.
The triangle is neither equilateral nor right.
Sample run of the program:
Enter an angle in degrees: 10
Enter an angle in degrees: 20
Enter an angle in degrees: 30
Cannot form a triangle from these angles.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!