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
What is the instantaneous center of zero velocity? List two approaches for determining the is the instantaneous center of zero v
Lera25 [3.4K]

Explanation:

Instantaneous center:

   It is the center about a body moves in planer motion.The velocity of Instantaneous center is zero and Instantaneous center can be lie out side or inside the body.About this center every particle of a body rotates.

From the diagram

Where these two lines will cut then it will the I-Center.Point A and B is moving perpendicular to the point I.

If we take three link link1,link2 and link3 then I center of these three link will be in one straight line It means that they will be co-linear.

I_{12},I_{23},I_{31} all\ are\ co-linear.

5 0
3 years ago
To find the reactance XLXLX_L of an inductor, imagine that a current I(t)=I0sin(ωt)I(t)=I0sin⁡(ωt) , is flowing through the indu
Sophie [7]

Answer:

V(t) = XLI₀sin(π/2 - ωt)

Explanation:

According to Maxwell's equation which is expressed as;

V(t) = dФ/dt ........(1)

Magnetic flux Ф can also be expressed as;

Ф = LI(t)

Where

L = inductance of the inductor

I = current in Ampere

We can therefore Express Maxwell equation as:

V(t) = dLI(t)/dt ....... (2)

Since the inductance is constant then voltage remains

V(t) = LdI(t)/dt

In an AC circuit, the current is time varying and it is given in the form of

I(t) = I₀sin(ωt)

Substitutes the current I(t) into equation (2)

Then the voltage across inductor will be expressed as

V(t) = Ld(I₀sin(ωt))/dt

V(t) = LI₀ωcos(ωt)

Where cos(ωt) = sin(π/2 - ωt)

Then

V(t) = ωLI₀sin(π/2 - ωt) .....(3)

Because the voltage and current are out of phase with the phase difference of π/2 or 90°

The inductive reactance XL = ωL

Substitute ωL for XL in equation (3)

Therefore, the voltage across inductor is can be expressed as;

V(t) = XLI₀sin(π/2 - ωt)

3 0
3 years ago
A steel pipe of 400-mm outer diameter is fabricated from 10-mm-thick plate by welding along a helix that forms an angle of 20° w
Verdich [7]

Explanation:

Outer di ameter d_{0}=400 \mathrm{mm}[tex] Thickness of the cylinder [tex]t=10 \mathrm{mm}

\therefore[tex] Inner diam eter [tex]d_{i}=d_{0}-2 t=400-2 \times 10

d_{1}=380 \mathrm{mm}

Given loading on the cylinder P=300 \mathrm{kN} Helix an gle of the weld form \theta=20^{\circ}

(i) Normal stress on the plane at angle \theta=20^{\circ} is

\sigma=\frac{P \cos ^{2} \theta}{A_{0}}

\text { Where } A_{0}=\frac{\pi}{4}\left(d_{0}^{2}-d_{1}^{2}\right)

\quad=\frac{\pi}{4}\left(400^{2}-380^{2}\right)

=12252.21 \mathrm{mm}^{2}

=12.25221 \times 10^{-9} \mathrm{m}^{2}

\sigma=\frac{-300 \times 10^{2} \times \cos ^{2} 20}{12.25221 \times 10^{-1}}

=-21.6 \mathrm{MPa}

(ii) Shear stress along an angle of \theta=20^{\circ} is \tau=\frac{P}{A_{0}} \cos \theta \sin \theta

=\frac{-300 \times 10^{-1} \times \cos 20 \times \sin 20}{12.25221 \times 10^{-3}}

=-7.86 \mathrm{MPa}

3 0
2 years ago
Air is compressed in a reversible, isothermal, steady- flow process from 15 psia, 100°F to 100 psia. Calculate the work of compr
mixas84 [53]

Answer:

|W|=169.28 KJ/kg

ΔS = -0.544 KJ/Kg.K

Explanation:

Given that

T= 100°F

We know that

1 °F = 255.92 K

100°F = 310 .92 K

P _1= 15 psia

P _1= 100 psia

We know that work for isothermal process  

W=mRT\ln \dfrac{P_1}{P_2}

Lets take mass is 1 kg.

So work per unit mass

W=RT\ln \dfrac{P_1}{P_2}

We know that for air R=0.287KJ/kg.K

W=RT\ln \dfrac{P_1}{P_2}

W=0.287\times 310.92\ln \dfrac{15}{100}

W= - 169.28 KJ/kg

Negative sign indicates compression

|W|=169.28 KJ/kg

We know that change in entropy at constant volume

\Delta S=-R\ln \dfrac{P_2}{P_1}

\Delta S=-0.287\ln \dfrac{100}{15}

ΔS = -0.544 KJ/Kg.K

3 0
3 years ago
what is the transfer function of the loaded filter? express your answer in terms of the variables r , l , rl , and s .
NISA [10]

Loaded, H_{Loaded}(s) = \frac{RR_{L} }{R+R_{L} } /(\frac{RR_{L} }{R+R_{L} }+SL) = \frac{RR_{L}/L }{R+R_{L} } /(\frac{RR_{L} /L}{R+R_{L} }+S) is the loaded filter's transfer function.

A graded filter that, by virtue of its weight and permeability, stabilises the foot of an earth dam or other construction when it is installed at the base of that structure.

Air filters with depth loaded are made to achieve precisely that. They add particles gradually to create air passageways, reducing constriction. You may save time and money by using filters that last longer thanks to them. The bigger particles are caught at the filter's beginning, while the smaller particles are caught as it gets closer. This is intended to avoid rapid surface loading, hence facilitating more airflow. This enables longer-lasting filtration as well.

On the other hand, surface loading filters catch every particle that is on its surface. No matter how big or little the particles are, it doesn't care.

Learn more about Loaded here:

brainly.com/question/20039214

#SPJ4

3 0
1 year ago
Other questions:
  • The lab technician you recently hired tells you the following: Boss, an undisturbed sample of saturated clayey soil was brought
    6·1 answer
  • Hi, I have an assignment in which i needs to write a report on (Rationalization of electrical energy consumption) and i need cha
    6·1 answer
  • A circular ceramic plate that can be modeled as a blackbody is being heated by an electrical heater. The plate is 30 cm in diame
    15·1 answer
  • An engineer designs a new bus that can drive 30 miles per gallon of fuel. Which of the following was likely one of the client’s
    10·2 answers
  • If a signal is transmitted at a power of 250 mWatts (mW) and the noise in the channel is 10 uWatts (uW), if the signal BW is 20M
    13·1 answer
  • A flow of 12 m/s passes through a 6 m wide, 2 m deep rectangular channel with a bed slope of 0. 001. If the mean velocity of flo
    12·1 answer
  • Only respond if your the person im talkin to
    14·1 answer
  • For a bolted assembly with eight bolts, the stiffness of each bolt is kb = 1.0 MN/mm and the stiffness of the members is km = 2.
    14·1 answer
  • When bending metal, the material on the outside of the curve stretches while the material on the inside of the curve compresses.
    14·1 answer
  • True or false? if i were to hook up an ac voltage source to a resistor, the voltage drop across the resistor would be in phase w
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!