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
As a new engineer hired by a company, you are asked evaluate an existing separation process for ethyl alcohol (ethanol) and wate
yanalaym [24]
C. Liquid- liq uid extraction
5 0
3 years ago
Assume a function requires 20 lines of machine code and will be called 10 times in the main program. You can choose to implement
Volgvan

Answer:

"Macro Instruction"

Explanation:

A macro definition is a rule or pattern that specifies how a certain input sequence should be mapped to a replacement output sequence according to a defined procedure. The mapping process that instantiates a macro use into a specific sequence is known as macro expansion.

It is a series of commands and actions that can be stored and run whenever you need to perform the task. You can record or build a macro and then run it to automatically repeat that series of steps or actions.

7 0
3 years ago
The high electrical conductivity of copper is an important design factor that helps improve the energy efficiency of electric mo
ludmilkaskok [199]

Answer:

B

Explanation:

This is a two sample t-test and not a matched pair t-test

null hypothesis(H0) will be that mean energy consumed by copper rotor motors is greater than or equal to mean energy consumed by aluminium rotor motors

alternate hypothesis(H1) will be that mean energy consumed by copper rotor motors is less than or equal to mean energy consumed by aluminium rotor motors.

So, option D is rejected

The hypothesis will not compare mean of differences of values of energy consumed by copper rotor motor and aluminium rotor motor.

Option A and C are also rejected

5 0
3 years ago
4. Which of the following is not part of a rear air-conditioning system?
Amanda [17]

Answer:

C. Rear AC compressor

Explanation:

Rear Ac compressor is not part of a rear air-conditioning system

4 0
3 years ago
The base class Pet has attributes name and age. The derived class Dog inherits attributes from the base class Pet class and incl
Nonamiya [84]

Answer:

Explanation:

class Pet:

   def __init__(self):

       self.name = ''

       self.age = 0

   def print_info(self):

       print('Pet Information:')

       print('   Name:', self.name)

       print('   Age:', self.age)

class Dog(Pet):

   def __init__(self):

       Pet.__init__(self)

       self.breed = ''

def main():

   my_pet = Pet()

   my_dog = Dog()

   pet_name = input()

   pet_age = int(input())

   dog_name = input()

   dog_age = int(input())

   dog_breed = input()

   my_pet.name = pet_name

   my_pet.age = pet_age

   my_pet.print_info()

   my_dog.name = dog_name

   my_dog.age = dog_age

   my_dog.breed = dog_breed

   my_dog.print_info()

   print('   Breed:', my_dog.breed)

main()

3 0
3 years ago
Other questions:
  • Identify the correct statements about Lesch-Nyhan syndrome. There is more than one correct statement.
    5·1 answer
  • This color curb is where parking is permitted for a limited time. The time constraints for that park will either be painted on t
    11·2 answers
  • When the rope is at an angle of α = 30°, the 1-kg sphere A has a speed v0 = 0.6 m/s. The coefficient of restitution between A an
    8·1 answer
  • Steam heated at constant pressure in a steam generator enters the first stage of a supercritical reheat cycle at 28 MPa, 5208C.
    10·1 answer
  • The signal propagation time between two ground stations in a synchronous satellite link is about millisecond is​
    11·1 answer
  • Multiple Select
    12·1 answer
  • PLEASE HELPPPPPPP!!!!,
    10·2 answers
  • What is the least count of screw gauge?<br> (a) 0.01 cm<br> (b) 0.001 cm<br> (c) 0.1 cm<br> (d) 1 mm
    13·1 answer
  • Which of these is not a type of socket
    6·1 answer
  • When operating a crane, which of the following is an important safety precaution? Select all that apply.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!