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]
3 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]3 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
The fins attached to a surface are determined to have an effectiveness of 0.9. Do the rate of heat transfer from the surface dec
Nesterboy [21]

Answer: The rate of heat transfer decreases.

Explanation:

Fin effectiveness is defined as the ratio of heat transfer rate from a  finned surface to the heat transfer rate from the same surface if there were no fins.  Its  value is expected to be greater than 1.

Having effectiveness  value of 0.9  which is less than 1 indicates that the heat transfer rate will decrease since a fin effectiveness smaller than 1 shows that the  fin acts as insulation (thermal insulation).

8 0
3 years ago
The increasing interconnections of peoples and countries around the world is known as ________.
Irina18 [472]
I think it’s rationalization.
Hope this helps
4 0
4 years ago
Read 2 more answers
Ammonia is one of the chemical constituents of industrial waste that must be removed in a treatment plant before the waste can s
Yanka [14]

Answer:

Following is attached the solution or the question given.

I hope it will help you a lot!

Explanation:

5 0
3 years ago
A 0.2-m^3 rigid tank equipped with a pressure regulator contains steam at 2MPa and 320C. The steam in the tank is now heated. Th
prohojiy [21]

Answer:

Q=486.49 KJ/kg

Explanation:

Given that

V= 0.2 m³

At initial condition

P= 2 MPa

T=320 °C

Final condition

P= 2 MPa

T=540°C

From steam table

At P= 2 MPa and T=320 °C

h₁=3070.15 KJ/kg

At P= 2 MPa and T=540°C

h₂=3556.64  KJ/kg

So the heat transfer ,Q=h₂ - h₁

Q= 3556.64 - 3070.15  KJ/kg

Q=486.49 KJ/kg

7 0
3 years ago
Air is saturated with water vapor at 35.0 oC and a total pressure of 1.50 atmospheres. If the molar flow rate of the dry air in
Marizza181 [45]

Answer:

11.541 mol/min

Explanation:

temperature = 35°C

Total pressure = 1.5 * 1.013 * 10^5 = 151.95 kPa

note : partial pressure of water in mixture = saturation pressure of water at T = 35°c )

from steam table it is = 5.6291 Kpa

calculate the mole fraction of H_{2}o ( YH_{2}o )

= 5.6291 / 151.95

= 0.03704

calculate the mole fraction of air ( Yair )

 = 1 - mole fraction of water

= 1 - 0.03704 = 0.9629

Now to determine the molar flow rate of water vapor in the stream

lets assume N = Total molar flow rate

NH_{2}o = molar flow rate of water

Nair = molar  flow rate of air = 300 moles /min

note : Yair * n = Nair

therefore n = 300 / 0.9629 = 311.541  moles /min

Molar flowrate of water

=  n -  Nair

= 311.541 - 300 = 11.541 mol/min

4 0
3 years ago
Other questions:
  • A minor road intersects a major 4-lane divided road with a design speed of 55mph and a median width of 8 feet. The intersection
    11·1 answer
  • Define ""acidity"" of an aqueous solution. How do you compare the strength of acidity of solutions ?
    6·1 answer
  • Fixed rate mortgage offer:
    10·1 answer
  • Convert 103.69 kN to TN.
    14·1 answer
  • What is the volume of the rectangular prism shown.
    9·1 answer
  • Steam enters a heavily insulated throttling valve at 11 MPa, 600°C and exits at 5.5 MPa. Determine the final temperature of the
    14·1 answer
  • Explain how feedback control is used to<br> adjust robotic movements.
    9·1 answer
  • Technician A says that fuel filler caps with pressure and vacuum vents are used with EVAP system fuel tanks. Technician B says t
    5·1 answer
  • Tech B says that long-term fuel trims that are positive means that the PCM is leaning out the fuel mixture from the base pulse-w
    11·2 answers
  • A motor takes 38 amperes on a 220-volt circuit. Find the horsepower output (hp) of the motor shown with an efficiency of 90%. Ex
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!