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
yuradex [85]
2 years ago
15

Write a program that accepts the lengths of three sides of a triangle as inputs. the program output should indicate whether or n

ot the triangle is a right triangle. recall from the pythagorean theorem that in a right triangle, the square of one side equals the sum of the squares of the other two sides. use the triangle is a right triangle. and the triangle is not a right triangle. as your final outputs.
Computers and Technology
1 answer:
omeli [17]2 years ago
4 0

The code will have to obey the Pythagorean theorem that says square of the hypotenuse side is equals to the sum of the squares of the other legs.

<h3>How to write a code that check if a triangle is a right angle by using Pythagoras theorem?</h3>

The code is written in python.

def right_triangle(x, y, z):

    if x**2 + y**2 == z**2 or y**2 + z**2 == x**2 or z**2 + x**2 == y**2:

         print("it is a right angle triangle")

    else:

         print("it is not a right angle triangle")

right_triangle(6, 10, 8)

<h3>Code explanation</h3>
  • we defined as function named "right_triangle". x, y and z are argument which are the length of the triangle.
  • Then we check if the sides obeys Pythagoras theorem.
  • If it does we print a positive statement else we print a negative statement.

Learn more about python at: brainly.com/question/21437082

#SPJ4

You might be interested in
Look at the slide.
svetlana [45]

Answer:

c

Explanation:

5 0
3 years ago
Read 2 more answers
____ devices are high-performance storage systems that are connected individually to a network to provide storage for the comput
Brut [27]

Answer:lmlmlmlmlmlm

Explanation:

4 0
4 years ago
Write a Java program in jGRASP that creates a 2D integer array of 5 rows and 20 columns, fills it with increasing integer values
Alex73 [517]

Answer:

As per the question we need to make 5 rowa and 2o columns, in this we have total element 100 so range should be 0 to 99, but we are suggested to keep range 0 to 59, so i have kept the elementns in the range, but if it was a typo in the question for range you do not need to reset the k with zero.

Explanation:

//create a new class  TestArray

public class TestArray {

//define main method

public static void main(String[] args) {

 //declare a 2D array of given size i.e. 5 rows and 20 columns

 int arr[][] = new int[5][20];

 //declare an integer variable k and initialize it with zero, this will used to initialize the array from 0 to 99

 int k = 0;

 //for loop for rows

 for (int i = 0; i < 5; i++) {

  //for loop for columns

  for (int j = 0; j < 20; j++) {

   //initialize arr with the current value of k

   arr[i][j] = k;

   //once k is 59 set it zero again as we are not going beyond 59

   if(k == 59)

    k = 0;

   //increment value of k with 1

   k++;

  }

 }

 //print the element from the array one by one

 //for loop for rows

 for (int i = 0; i < 5; i++) {

  //for loop for columns

  for (int j = 0; j < 20; j++) {

   //print the current element of array and an space with it

   System.out.print(arr[i][j]+" ");

  }

  // move the cursor to new line

  System.out.println();

 }

}

}

7 0
4 years ago
Which search strategy explores nodes from the initial state as well as the goal state?
Simora [160]
Pretty sure it’s c! I’m not 100% tho sorry if I’m wrong have a nice day:)
5 0
3 years ago
Read 2 more answers
Read the following scenario, and then answer the question.
maxonik [38]

Answer:

Monitor size

Explanation:

Hope this helps

4 0
3 years ago
Read 2 more answers
Other questions:
  • Assume that a program consists of integer and floating-point instructions. 60% of the total execution time is spent on floating
    7·1 answer
  • what important technology has done the most to allow small businesses a change to compete with larger international companies?
    5·1 answer
  • A type of specialty processor devoted exclusively to protecting your privacy.
    9·2 answers
  • (a) Explain the difference between a web browser and a search engine.​
    15·1 answer
  • A photo's color intensity can be modified by changing the brightness and content.
    9·1 answer
  • Design and implement an application that reads an integer value representing a year from the user. The purpose of the program is
    6·1 answer
  • Write a short program that uses a for loop to populate an array. The array can store up to 10 integers. Modify the code slightly
    12·1 answer
  • En su cuaderno o carpeta de trabajo realice la conversión del sistema de numeración binario a octal según este ejemplo de manera
    13·1 answer
  • Use rounding to decide if the answer is reasonable. Write
    15·1 answer
  • What are LinkedIn automation tools used for?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!