Question
Write a C++ program to analyze a variety of triangles. Please pay attention to all the details needed. A lot have been posted that are
Write a C++ program to analyze a variety of triangles. Please pay attention to all the details needed. A lot have been posted that are similar but all done wrong. Also do not use float to assign. 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 valid. In particular, the following conditions must be met: Both sides > 0 If angle is in degrees, then 0 < angle < 180 (if angle is in radians, convert it to degrees first and then check) Option 2: 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 and then check) For the sum of the two angles entered: 0 < Sum < 180 (if angles are in radians, convert them to degrees first and then check) Option 3: Given three sides First check to be sure that the three sides entered form a valid triangle. For the triangle to be valid, 6 conditions must be met: a > 0, b > 0, c > 0 a < b+c, b Other program requirements: Bad inputs include invalid triangles, invalid menu choices, and invalid units for angles. if (Side < 0) { cout << Error. Negative value for side not allowed. Program terminated.; Return 1; } Report: Follow all guidelines in the document Format for Programming Projects (see Blackboard site). Extra Credit Suggestions: You can earn up to 10 additional points on this programs grade. The number of points awarded depends on the complexity or creativity of the feature. Here are a few ideas: 1. If an incorrect entry is made by the user, display an error message and request that the user re-enter the information. This can be done fairly easily using a do while loop (covered in Ch. 6).
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started