1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Eddi Din [679]
2 years ago
10

In a right triangle, the square of the length of one side is equal to the sum of the squares of the lengths of the other two sid

es. Write a program that prompts the user to enter the lengths of three sides of a triangle and then outputs a message indicating whether the triangle is a right triangle. Assume the user does not know the hypotenuse. You may NOT ask the user for the hypotenuse. Meaning, you have to check all 3 sides to verify that it is a right-angled triangle.
Engineering
1 answer:
Dovator [93]2 years ago
8 0

Answer:

C++ code is explained below

Explanation:

/Remove the following line

//if not using visual studio.

#include "stdafx.h"

//Import the required header files.

#include <iostream>

using namespace std;

//Define the main function.

int main(void)

{

    //Define the variables.

    double side1, side2, side3;

    //Prompt the user to enter the sides of the triangle.

    cout << "Enter the side of the triangle:" << endl;

    cout << "Enter first side of triangle:" << endl;

    cin >> side1;

    cout << "Enter second side of triangle:" << endl;

    cin >> side2;

    cout << "Enter third side of triangle:" << endl;

    cin >> side3;

    cout << endl;

    //Check if the triangle sides are valid

    if ((side1 + side2 > side3) &&

         (side1 + side3 > side2) &&

         (side2 + side3 > side1))

    {

         //Check the condition for right angle triangle

         if ((side3*side3 == (side1*side1 + side2*side2)) ||

             (side2*side2 == (side3*side3 + side1*side1)) ||

             (side1*side1 == (side3*side3 + side2*side2)))

//Display that the triangle is right-angled triangle.

             cout << "It is a right-angled triangle." << endl;

         else

//Display that the triangle is not the right-//angled triangle.

             cout << "It is not a right-angled triangle."

<< endl;

    }

    else

         //Display not the valid side.

         cout << "Not a valid side." << endl;

    //Remove the following line if

    //not using visual studio.

    system("pause");

    return 0;

}

You might be interested in
A heat recovery system​ (HRS) is used to conserve heat from the surroundings and supply it to the Mars Rover. The HRS fluid loop
blagie [28]

Answer:

0.304 L of Freon is needed

Explanation:

Q = mCT

Q is quantity of energy that must be removed = 47 BTU = 47×1055.06 = 49587.82 J

C is specific heat of Freon = 74 J/mol.K = 74 J/mol.K × 1 mol/120 g = 0.617 J/g.K

T is temperature in the area of Mars = 189 K

m = Q/CT = 49587.82/(0.617×189) = 452.23 g = 452.24/1000 = 0.45223 kg

Density of Freon = specific gravity of Freon × density of water = 1.49 × 1000 kg/m^3 = 1490 kg/m^3

Volume of Freon = mass/density = 0.45223/1490 = 0.000304 m^3 = 0.000304×1000 = 0.304 L

7 0
2 years ago
How would you expect an increase in the austenite grain size to affect the hardenability of a steel alloy? Why?
seraphim [82]

Answer:

The hardenability increases with increasing austenite grain size, because the grain boundary area is decreasing. This means that the sites for the nucleation of ferrite and pearlite are being reduced in number, with the result that these transformations are slowed down, and the hardenability is therefore increased.

3 0
3 years ago
What can your employer do to protect you from overhead power lines?
agasfer [191]

Answer:

Have the power company install insulated sleeves (also known as “eels”) over power lines.​

Wearing PPE is the only way to prevent being electrocuted

Explanation:

To prevent electrocution at workplace, employers can ensure that the  power company install insulated sleeves (also known as “eels”) over power lines.​ Additionally, the employees should wear PPEs which are insulators to prevent electrocution.

5 0
3 years ago
The thrust angle is checked by referencing
anygoal [31]

In Engineering, the thrust angle is checked by referencing: C. vehicle centerline.

<h3>What is a thrust angle?</h3>

A thrust angle can be defined as an imaginary line which is drawn perpendicularly from the centerline of the rear axle of a vehicle, down the centerline.

This ultimately implies that, the thrust angle is a reference to the centerline (wheelbase) of a vehicle, and it confirms that the two wheels on both sides are properly angled within specification.

Read more on thrust angle here: brainly.com/question/13000914

#SPJ1

5 0
1 year ago
Find At Least Three Instances Of Set Constructions In Your CS Courses And Use Them To Exhibit All Set Operations Discussed In Cl
hoa [83]

An expertly designed format for arranging, processing, accessing, and storing data is called a data structure.

Data structures come in both simple and complex forms, all of which are made to organize data for a certain use. Users find it simple to access the data they need and use it appropriately thanks to data structures. The organizing of information is framed by data structures in a way that both machines and people can better grasp. A data structure may be chosen or created in computer science and computer programming to store data in order to be used with different methods. In some circumstances, the design of the data structure and the algorithm's fundamental operations are closely related. Each data structure comprises information about the data values, relationships between the data and — in some situations — functions that can be applied to the data. For instance, in an object-oriented programming language, the data structure and its related methods are tied together as part of a class description. Although they may be designed to operate with the data structure in non-object oriented languages, these functions are not considered to be a part of the data structure. A data structure may be chosen or created in computer science and computer programming to store data in order to be used with different methods. In some circumstances, the design of the data structure and the algorithm's fundamental operations are closely related. Each data structure comprises information about the data values, relationships between the data and — in some situations — functions that can be applied to the data.

Know more about data structure here:

brainly.com/question/29487957

#SPJ4

4 0
1 year ago
Other questions:
  • A piston cylinder assembly fitted with a slowly rotating paddle wheel contains 0.13 kg of air at 300K. The air undergoes a const
    10·1 answer
  • The flatbed truck carries a large section of circular pipe secured only by the two fixed blocks A and B of height h. The truck i
    14·2 answers
  • Give four effects of water hammer.​
    6·1 answer
  • Mobility refers to the ability to?
    12·1 answer
  • An engineer is trying to build a new measurement tool. Which step should the engineer complete first? A. Design a model of the t
    8·1 answer
  • What is the name of the part that supports the headlight assembly?
    15·1 answer
  • Why are there few effective HCI standards?
    6·1 answer
  • can anyone help me with this please.i have the current and pf for branch 1 and 2 but cant figure out the total current, pf and a
    12·1 answer
  • Describe how you would control employee exposure to excessive noise in a mining environment
    14·1 answer
  • Write a statement that calls the recursive method backwardsAlphabet() with parameter startingLetter.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!