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
A 46.0-g meter stick is balanced at its midpoint (50.0 cm, zero point is a left end of stick). Then a 210.0-g weight is hung wit
Anna71 [15]

Clockwise torque due to 100g is 0.1029 Nm and 200g is 1.4406 Nm. Clockwise torque due to stick mass is 0.2254 Nm and Counter-clockwise torque due to normal force is 1.7689 Nm.            

<h3>What is clockwise torque?</h3>

The right-hand rule for cross products determines the direction of torque, which is calculated as the cross product of force and distance. Your thumb will point in the direction of the torque if you place your palm in the direction of the applied force and extend your fingers from the pivot point in that direction.

A related right-hand rule relates the direction of the rotation to the direction of the torque. Your fingers will curl in the direction of rotation if you point your thumb in the direction of the torque.

Positive torques cause counter clockwise rotation, while negative torques cause clockwise rotation.

The sum of all torques must be zero at equilibrium since an object in equilibrium has no net torque.

When the force is applied in a direction perpendicular to the line connecting the pivot and the force, the torque is at its greatest.

You can calculate the torque's magnitude using

                                             \begin{displaymath}\tau =rF_{\bot }=rF\sin \theta .\end{displaymath}

To solve problems involving torques, follow these eight steps: read the issue, create a free-body diagram, locate the pivot point, write down the expressions for all torques, For equilibrium conditions, set the sum of torques to zero, list all known variables, pick the desired variable(s), write down equations involving those variable(s), solve the equations, plug in numbers, and test your solution.

Clockwise torque due to 100 g                                                                         ⇒ T1 = 0.105* 9.8* 0.1 = 0.1029 Nm

Clockwise torque due to 200 g                                                                                                      ⇒ T2 = 0.210* 9.8* 0.7 = 1.4406 Nm

Clockwise torque due to stick mass                                                                               ⇒ T3 = 0.046* 0.5* 9.8 =0.2254 Nm

Counter-clockwise torque due to normal force                                                                             ⇒ T4 = (0.046 + 0.21 + 0.105)*9.8* 0.5 = 1.7689 Nm

Learn more about torque

brainly.com/question/1544595

#SPJ4

7 0
1 year ago
Tech a says the higher the numarical gear ratio (4:1), the more torque that will be applied to the wheels. Tech b says that the
Zepler [3.9K]

Answer:

Tech A

Explanation:

The amount of energy required to apply the same force with a 1:1 ratio is divided into 4, so you can apply 4 times as much force than a 1:1 ratio. efficiency and speed come into play here, but assuming the machine powering the gear can run at a unlimited RPM, 4:1 will have more force and a slower output speed than a 2:1 ratio.

3 0
3 years ago
Read 2 more answers
Foam weather stripping is often placed in the frames of doors and
Firdavs [7]

Answer:

prevents weathering

Explanation:

6 0
3 years ago
Which of the following describes all illustrations created by freehand?
Klio2033 [76]

extension lines,sketches,leader lines,dimensions describes all illustrations created by freehand.

5 0
3 years ago
Read 2 more answers
A road has a crest curve, where the PVI station is a 71 35. The road transitions from a 2.1% grade to a -3.4% grade. The highest
sveticcg [70]

Answer:

Stat PVC = Stat(82+98.5)

Stat PVT = Stat(59+71.5)

Explanation

PVI = 71 + 35

Let G1 = Grade 1; G2 = Grade 2

G1 = +2.1% ; G2 = -3.4%

Highest point of curve at station = 74 + 10

General equation of a curve:

y = ax^{2} +bx+c\\dy/dx=2ax+b\\

At highest point of the curve dy/dx=o

2ax+b=0\\x=-b/2a\\x=G1L/(G2-G1)\\x=L/2 +(stat 74+10)-(stat 71+35)\\x=L/2 + 275

-G1L/(G2-G1) = (L/2 + 275)/100\\L = -2327 ft\\Station PVC = Stat(71+35)+(-2327/2)\\\\Stat PVC = 7135-1163.5\\Stat PVC = Stat(82+98.5)\\

Station PVT

Station PVT = Stat PVI + (L/2)\\Station PVT = Stat(71+35)+(-2327/2)\\Station PVT = 7135-1163.5\\Stat PVT = Stat(59+71.5)

3 0
3 years ago
Other questions:
  • 2.14 (a) Using series/parallel resistance reductions, find the equivalent resistance between terminals A and B in the circuit of
    14·1 answer
  • Technician A says a basic circuit problem can be caused by something in the circuit that increases voltage. Technician B says a
    8·1 answer
  • How much work is performed if a 400 lb weight is lifted 10 ft ?
    8·1 answer
  • Two loads connected in parallel draw a total of 2.4 kW at 0.8 pf lagging from a 120-V rms, 60-Hz line. One load absorbs 1.5 kW a
    5·1 answer
  • Explain with examples:<br> What are the reasons of a successful and unsuccessful software project?
    8·1 answer
  • Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    9·1 answer
  • An agricultural manager requires
    12·1 answer
  • Their game off badminton is always on Tuesday
    11·1 answer
  • What are the horizontal structures beneath a slab that help transfer the load from the slab to the columns?
    14·2 answers
  • Which of the given strategies is specifically a competitive advantage sustainment strategy?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!