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
If an object has the same number of positive and negative charges, its electrical charge is
N76 [4]

When an object has the same number of positive and negative charges, its electrical charge will become neutral.

What is an electric charge?

When the matter is put in an electromagnetic field, it has an electric charge, which causes it to experience a force. A positive or negative electric charge can exist.

Now when the two equal magnitude charges with opposite natures come together they become neutral.

To know more about charges follow

brainly.com/question/24391667

#SPJ4

7 0
2 years ago
There are three options for heating a particular house: a. Gas: $1.33/therm where 1 therm=105,500 kJ b. Electric Resistance: $0.
sergejj [24]

Answer:

Option ‘a’ is the cheapest for this house.

Explanation:

Cheapest method of heating must have least cost per kj of energy. So, convert all the energy in the same unit (say kj) and take select the cheapest method to heat the house.

Given:

Three methods are given to heat a particular house are as follows:

Method (a)

Through Gas, this gives energy of amount $1.33/therm.

Method (b)

Through electric resistance, this gives energy of amount $0.12/KWh.

Method (c)

Through oil, this gives energy of amount $2.30/gallon.

Calculation:

Step1

Change therm to kj in method ‘a’ as follows:

C_{1}=\frac{\$ 1.33}{therm}\times(\frac{1therm}{105500kj})

C_{1}=1.2606\times10^{-5} $/kj.

Step2

Change kWh to kj in method ‘b’ as follows:

C_{2}=\frac{\$ 0.12}{kWh}\times(\frac{1 kWh }{3600kj})

C_{2}=3.334\times10^{-5} $/kj.

Step3

Change kWh to kj in method ‘c’ as follows:

C_{3}=\frac{\$ 2.30}{gallon}\times(\frac{1 gallon }{138500kj})

C_{3}=1.66\times10^{-5} $/kj.

Thus, the method ‘a’ has least cost as compare to method b and c.

So, option ‘a’ is the cheapest for this house.

 

5 0
3 years ago
Oil with a density of 800 kg/m3 is pumped from a pressure of 0.6 bar to a pressure of 1.4 bar, and the outlet is 3 m above the i
Naddik [55]

Answer:

23.3808 kW

20.7088 kW

Explanation:

ρ = Density of oil = 800 kg/m³

P₁ = Initial Pressure = 0.6 bar

P₂ = Final Pressure = 1.4 bar

Q = Volumetric flow rate = 0.2 m³/s

A₁ = Area of inlet = 0.06 m²

A₂ = Area of outlet = 0.03 m²

Velocity through inlet = V₁ = Q/A₁ = 0.2/0.06 = 3.33 m/s

Velocity through outlet = V₂ = Q/A₂ = 0.2/0.03 = 6.67 m/s

Height between inlet and outlet = z₂ - z₁ = 3m

Temperature to remains constant and neglecting any heat transfer we use Bernoulli's equation

\frac {P_1}{\rho g}+\frac{V_1^2}{2g}+z_1+h=\frac {P_2}{\rho g}+\frac{V_2^2}{2g}+z_2\\\Rightarrow h=\frac{P_2-P_1}{\rho g}+\frac{V_2^2-V_1^2}{2g}+z_2-z_1\\\Rightarrow h=\frac{(1.4-0.6)\times 10^5}{800\times 9.81}+\frac{6.67_2^2-3.33^2}{2\times 9.81}+3\\\Rightarrow h=14.896\ m

Work done by pump

W_{p}=\rho gQh\\\Rightarrow W_{p}=800\times 9.81\times 0.2\times 14.896\\\Rightarrow W_{p}=23380.8\ W

∴ Power input to the pump 23.3808 kW

Now neglecting kinetic energy

h=\frac{P_2-P_1}{\rho g}+z_2-z_1\\\Righarrow h=\frac{(1.4-0.6)\times 10^5}{800\times 9.81}+3\\\Righarrow h=13.19\ m\\

Work done by pump

W_{p}=\rho gQh\\\Rightarrow W_{p}=800\times 9.81\times 0.2\times 13.193\\\Rightarrow W_{p}=20708.8\ W

∴ Power input to the pump 20.7088 kW

6 0
3 years ago
PLEASE HELP QUICK!!
ivolga24 [154]

R01= 14.1 Ω

R02=  0.03525Ω

<h3>Calculations and Parameters</h3>

Given:

K= E2/E1 = 120/2400

= 0.5

R1= 0.1 Ω, X1= 0.22Ω

R2= 0.035Ω, X2= 0.012Ω

The equivalence resistance as referred to both primary and secondary,

R01= R1 + R2

= R1 + R2/K2

= 0.1 + (0.035/9(0.05)^2)

= 14.1 Ω

R02= R2 + R1

=R2 + K^2.R1

= 0.035 + (0.05)^2 * 0.1

= 0.03525Ω

Read more about resistance here:

brainly.com/question/17563681

#SPJ1

5 0
2 years ago
The results of a _________ test will determine if there is suitable drainage and the size of the drain field that will be requir
topjm [15]

Answer:

The results of a percolation test will determine if there is suitable drainage and the size of the drain field that will be required for a septic system.

7 0
2 years ago
Other questions:
  • Use the convolutional integral to find the response of an LTI system with impulse response ℎ(????) and input x(????). Sketch the
    8·1 answer
  • An air conditioner using refrigerant R-134a as the working fluid and operating on the ideal vapor-compression refrigeration cycl
    12·1 answer
  • Methane gas at 25°C, 1 atm enters a reactor operating at steady-state and burns with 80% theoretical air entering at 227°C, 1 at
    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
  • What is the main role of matrix in composites! a)-to transfer stress to the other phases b)- to protect phases from environment
    7·1 answer
  • Consider a metal single crystal oriented such that the normal to the slip plane and the slip direction are at angles of 43.1 deg
    6·1 answer
  • Im passed due someone help meeeeeee
    7·2 answers
  • A Styrofoam cup (k = 0.010 W/(m∙ o C)) has cross-sectional area (A) of 3.0 x 10 −2m 2 . The cup is 0.589 cm thick (L). The tempe
    12·1 answer
  • PLS HELP! which statement is the best example of how society affects the useof technology? A. Farmers in hilly areas grow crops
    10·1 answer
  • You are coming to this intersection, and are planning on turningright. There is a vehicle close behind you. You should?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!