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
Lena [83]
3 years ago
14

Write a function is_rightangled which, given the length of three sides of a triangle, will determine whether the triangle is rig

ht-angled. Assume that the third argument to the function is always the longest side. It will return True if the triangle is right-angled, or False otherwise. Hint: floating point arithmetic is not always exactly accurate, so it is not safe to test floating point numbers for equality. If a good programmer wants to know whether x is equal or close enough to y, they would probably code it up as
Computers and Technology
1 answer:
Olenka [21]3 years ago
5 0

Answer:

Written in Python:

def is_rightangled(a,b,c):

     if abs(c**2 - (a**2 + b**2) < 0.001):

           return "True"

     else:

           return "False"

       

a = float(input("Side 1: "))

b = float(input("Side 2: "))

c = float(input("Side 3: "))

print(is_rightangled(a,b,c))

Explanation:

The function is defined here

def is_rightangled(a,b,c):

The following if statement implements Pythagoras theorem c^2 = a^2 + b^2 by checking if the left hand side is approximately equal to the right hand side

<em>      if abs(c**2 - (a**2 + b**2) < 0.001):</em>

<em>            return "True"</em>

<em>      else:</em>

<em>            return "False"</em>

If the specified condition is met, the if function returns true; Otherwise, it returns false.

The main function starts here

The next three line prompts user for the sides of the triangle

<em>a = float(input("Side 1: "))</em>

<em>b = float(input("Side 2: "))</em>

<em>c = float(input("Side 3: "))</em>

The next line calls the defined function

print(is_rightangled(a,b,c))

You might be interested in
What is analog computer? where is it used​
hichkok12 [17]

Explanation:

analogue computer is in computer which is used to process analogue data.

Analogue computer were widely used in scientific and industrial application

3 0
3 years ago
Read 2 more answers
structured analysis is called a(n) _____ technique because it focuses on processes that transform data into useful information.
zzz [600]

Answer:

Process - centered technique

Explanation:

Process - centered technique -

It is the method , where the useless or waste data is converted to some useful information , is referred to as process - centered technique .

This conversion process requires some activities , like  maintenance/support  , implementation , design , analysis and  planning .

Hence , from the given information of the question,

The correct option is Process - centered technique .

4 0
3 years ago
Everybody at a company is assigned a unique 9 digit ID. How many unique IDs exist?
timama [110]

Answer:

3,265,920 unique ID exist.

Explanation:

The nine digits are from 0 to 9, there are ten bits from 0 -9,

0, 1, 2, 3, 4, 5, 6, 7, 8, 9

The first is select from the highest bit (9), and the second is selected at random from 0 - 9, the third bit to the last must be unique and different from each other;

number of unique IDs = 9 × 9 × 8 × 7 × 6 × 5 × 4 × 3 × 2

Multiplying the nine bits of unique IDs = 3,265,920.

3 0
3 years ago
John is an entrepreneur who plans to enter a franchise contract with a hotel business. Which of these is an advantage that John
ladessa [460]

The answer is C:

In most Franchise businesses, the franchisor provides ongoing guidance and support, and a developed way of doing business. In addition, they offer a higher rate of success as compared to start-up businesses and you may find it easier to secure finances for a franchise. You will get all the benefits that are attached with big businesses for a small business ownership.

3 0
3 years ago
Read 2 more answers
Tower of Hanoi algorithm 4 disks
Sophie [7]
????is this a question
4 0
3 years ago
Read 2 more answers
Other questions:
  • SMART PEOPLE NEEDED
    11·1 answer
  • Consider two different implementations, M1 and M2, of the same instruction set. There are three classes of instructions (A, B, a
    14·1 answer
  • Universal Containers needs to add an additional recipient to a workflow email alert that isfired from the case object. What type
    6·1 answer
  • Which of the following is a good precaution to take when making online purchases? (1 point)
    15·1 answer
  • How can you create an illusion of spatial depth in a two-dimensional design?
    15·1 answer
  • Cloud computing is an old phenomenon in computing infrastructure dating back to the early days of the Internet that involves mov
    10·1 answer
  • Which job role requires you to create user guides for computer products and services?
    11·1 answer
  • write a C++ program that ask the user for the number of cookies eaten and display the calorie consumption
    9·1 answer
  • 9. Which of the following is considered an interface? (1 point)
    11·1 answer
  • What is the answer in music class
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!