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
Create a dictionary with types as integer and string.
Airida [17]

Answer:

In c#  Dictionary is the collection of keys and value .The dictionary is a generic collection class which is in the System.Collection.Generics namespace. we can represent dictionary like that Dictionary<TKey, TValue> where TKey represent the type of key and TValue is the type of TValue.

Following are the example which represent dictionary as integer and string

using System.Collections.Generic;  // namespace

class Test // class test

{

   static void Main()  // main method

   {

       

       var ob = new Dictionary< int,string>();  // type integer and string

       dictionary.Add( 2,"hello");

       dictionary.Add(143,"hello1);

       // The dictionary has 2 pairs.

       Console.WriteLine("DICTIONARY 1 " + ob.Count);

}

}

Output:

DICTIONARY 1 :2

Explanation:

In this program we create a dictionary generic class which is integer and string type after that we add the elements in the dictionary by   "dictionary.Add method " and finally print the count of dictionary

7 0
3 years ago
What Network does zoom run on? Does anyone use it (hint Hint)
rewona [7]

Answer:

  • The bandwidth used by Zoom will be optimized for the best experience based on the participant's' network. It will automatically adjust for 3G, WiFi, or wired environments.
  • i use g00gle meet bc zoom does not work on my school macbook...

Explanation:

:)

3 0
3 years ago
which consumable would be used with a 3d printer? group of answer choices filament print ribbon toner cartridge ink
Anna35 [415]

Answer:

Filament

Explanation:

Filament is the plastics that 3d printers use to make objects.

7 0
2 years ago
Carl wants to add a new slide to his PowerPoint presentation. Which option should he use?
djverab [1.8K]

Answer:

C on edg

Explanation:

I just took the review

8 0
3 years ago
Read 2 more answers
What is the output of 1101×10==11000+10
aliya0001 [1]

Answer:

west ward cpt output

Explanation:

i know because i invented it

6 0
3 years ago
Other questions:
  • a computer that no longer works after having minor repair work done to it may have been damaged by ______.
    6·1 answer
  • Which of these is a subdirectory? <br> HTTPS <br> /FAQ <br> .org <br> WWW
    15·1 answer
  • Which of the following statements is false? People tend to shortcut security procedures because the procedures are inconvenient.
    13·1 answer
  • How many people employed in the United States work in a job related to digital media?
    12·1 answer
  • The diagnostic test that involves watching a computer monitor with alternating checkerboard patterns while an eeg is performed i
    11·2 answers
  • You need to extract data from the system your predecessor created. you discover tables have been created according to the third
    7·1 answer
  • You work in an office that uses Linux and Windows servers. The network uses the IP protocol. You are sitting at a Windows workst
    13·1 answer
  • Ayúdenme con estas preguntas son para mañana porfis!!!
    12·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    11·2 answers
  • Limitations of systems analysis and design​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!