c++ 17 please help!!
A triangle can be of three types-one in which all the sides are equal, or one in which only two sides are equal, or one in which all the three sides are unequal. You are assigned to write a program that allows the user to enter the three sides of a triangle. The program should use three double variables to store the three sides of the triangle. The program should also be able to print the three angles of the triangle if the triangle is equilateral. If the triangle is isosceles, it should prompt the user to print the angle that is different and then print the remaining angles. Finally, if the triangle is scalene, the program should do nothing. Thus, there should be variables for holding the angles that are to be printed
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
double a,b,c;
double ang,s_ang;
cout<<"Enter The Value Of a,b,c \n";//side's of
triangle
cin>>a>>b>>c;
if(a==b && b==c && c==a)
{
cout<<"The Triangle is Equilateral and the Angle is 60
degree\n";
}
else if(a==b || b==c || c==a)
{
cout<<"The Triangle is Isosceles and enter the angle which is
different:\n";
cin>>ang;
s_ang=(180-ang)/2;
cout<<"The angles are"<<s_ang;
}
/*else if(a*a==b*b+c*c ||b*b==c*c+a*a || c*c==a*a+b*b)
{
cout<<"The Triangle is Right angled\n";
}*/
else
{
cout<<"The Triangle Scalene angled\n";
}
return 0;
}
Solution:
Enter The Value Of a,b,c 3 3 3
The Triangle is Equilateral and the Angle is 60 degree
Enter The Value Of a,b,c 3 3 4
The Triangle is Isosceles and enter the angle which is different: 75
The angles are 52.5
Enter The Value Of a,b,c 3 4 5
The Triangle Scalene angled
c++ 17 please help!! A triangle can be of three types-one in which all the sides...
10. Write a Python program to check if a triangle is equilateral, isosceles or scalene. An equilateral triangle is a triangle in which all three sides are equal. A scalene triangle is a triangle that has three unequal sides An isosceles triangle is a triangle with (at least) two equal sides
It is required to read three real numbers that represent the sides of a possible triangle. For the sides to form a triangle, the sum of each pair of sides must be greater than the third side. This has to be fulfilled for each pair of sides. The program must determine the values of the following alphanumeric variables (string type): tria: You will be assigned the value "triangle" if the three real numbers form a triangle or the value of...
Your math professor asked you to determine whether triangles are equilateral, isosceles, or scalene triangles. You need to write a MATLAB program that accepts the side lengths for sides A, B, and C of a triangle and compares the side lengths in order to determine if the triangle is equilateral, isosceles, or scalene. Each triangle will only be classified as a single type based on the definitions below: 1. An equilateral triangle is a triangle in which all three sides...
***IN PYTHON: Scalene triangle: All sides have different lengths Isosceles triangle: Two sides have the same length Equilateral triangle: All sides are equal Write a program to ask for the length of 3 sides a, b and c. Ask for three sides at a time Determine the type of triangle given three sides Handle all kinds of errors - 1. not integers, int() conversion fails 2. not enough args, 3. too many arguments HINT: use the len() function to check...
An equilateral triangle is a triangle with all three sides of equal length. All of the angles in an equilateral triangle are equal. What is the measure of angle θ in the triangle shown?(Figure 1) Recall that the sum of the angles in a triangle equals 180∘. Express your answer in degrees.
In C program #include<stdio.h> Task is to implement the Triangle Program in C. The specification for the program is: The triangle program accepts three strings, a, b, and c (the sides of a triangle) as command line parameters. The sides of the triangle must be integers. The sides a, b, and c must satisfy the following conditions: c1. 1 ≤ a ≤ 200 c2. 1 ≤ b ≤ 200 c3. 1 ≤ c ≤ 200 c4. a < b +...
(JAVA) Implement a Triangle class. Any triangle can be represented by its THREE sides. Therefore, your class will have THREE private member variables → side1, side2 and side3. Use the double data type to represent the triangle sides. In addition, please provide public methods that perform the following FIVE tasks: ▪ An input method that obtains the appropriate values for the three sides from the user. While entering the values of the three sides, please remember the triangle property that...
PLEASE READ AND CODE IN BASIC C++ CODE. ALSO, PLEASE CODE USING
THIS DO WHILE LOOP AND FORMAT:
#include <iostream>
using namespace std;
int main() {
//variables here
do {
// program here
}while (true);
}
Objectives To learn to code, compile and run a program containing SELECTION structures Assignment Write an interactive C++.program to have a user input the length of three sides of a triangle. Allow the user to enter the sides...
help im alittle lost my teacher posted all this its suppose to
be in C++ language.
can yoh leave comments ans type the code thank you
Write a C++ program that accepts the lengths of three sides (a,b,c) of a triangle as input from the user Validate the user input, so that sides a, b, c can only be POSITIVE. The program output should indicate whether or not the triangle is an Equilateral Triangle, a Right Triangle, Isosceles which is...
JAVA question
Interface and Abstract Class (20 pts): There are three types of triangles in terms of how many sides are equal: • Equilateral Isosceles Scalene There are three types of triangles in terms of the degrees of interior angles: • Right · Acute . Obtuse Right Isosceles triangle is a right triangle, as well as an isosceles triangle. Triangle 590° Right triangle Isosceles triangle Right isosceles triangle Create a public interface Triangle, add the following method signatures: • double...