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
Advocard [28]
3 years ago
6

Input 3 positive integers from the terminal, determine if tlrey are valid sides of a triangle. If the sides do form a valid tria

ngle, output the type of triangle - equilateral, isosceles, or scalene - and the area of the triangle. If the three integers are not the valid sides of a triangle, output an appropriats message and the 3 sides. Be sure to comment and error check in your progam.
Computers and Technology
1 answer:
butalik [34]3 years ago
4 0

Answer:

In Python:

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

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

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

if side1>0 and side2>0 and side3>0:

   if side1+side2>=side3 and side2+side3>=side1 and side3+side1>=side2:

       if side1 == side2 == side3:

           print("Equilateral Triangle")

       elif side1 == side2 or side1 == side3 or side2 == side3:

           print("Isosceles Triangle")

       else:

           print("Scalene Triangle")

   else:

       print("Invalid Triangle")

else:

   print("Invalid Triangle")

Explanation:

The next three lines get the input of the sides of the triangle

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

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

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

If all sides are positive

if side1>0 and side2>0 and side3>0:

Check if the sides are valid using the following condition

   if side1+side2>=side3 and side2+side3>=side1 and side3+side1>=side2:

Check if the triangle is equilateral

<em>        if side1 == side2 == side3: </em>

<em>            print("Equilateral Triangle") </em>

Check if the triangle is isosceles

<em>        elif side1 == side2 or side1 == side3 or side2 == side3: </em>

<em>            print("Isosceles Triangle") </em>

Otherwise, it is scalene

<em>        else: </em>

<em>            print("Scalene Triangle") </em>

Print invalid, if the sides do not make a valid triangle

<em>    else: </em>

<em>        print("Invalid Triangle") </em>

Print invalid, if the any of the sides are negative

<em>else: </em>

<em>    print("Invalid Triangle")</em>

You might be interested in
What type of database contains multiple collections of data that are related to one another cells
statuscvo [17]
The different types<span> of </span>databases<span> include operational </span>databases<span>, end-user </span>databases<span>, distributed </span>databases<span>, analytical </span>databases<span>, relational </span>databases<span>, hierarchical </span>databases<span> and </span>database<span> models. 

Source Bing</span>
7 0
3 years ago
Martha and her project group want to present the class their work in the form of a slideshow that includes charts. Which applica
Gennadij [26K]

Answer:

Your answer is D.  multimedia software

Explanation:

6 0
3 years ago
In unreal engines which class should be used to define the rules of the game
mel-nik [20]

Answer: The number of players and spectators present, as well as the maximum number of players and spectators allowed.

Explanation: players

8 0
3 years ago
Zadanie nr 1
Gennadij [26K]

Answer:

Explanation:

Rezonans, Obiekt bez wibracji ma tendencję do robienia tego z określoną częstotliwością zwaną naturalną lub rezonansową częstotliwością obiektu. (Ta częstotliwość zależy od wielkości, kształtu i składu przedmiotu). Taki przedmiot będzie silnie wibrował, gdy zostanie poddany wibracjom lub regularnym impulsom o częstotliwości równej lub bardzo zbliżonej do swojej częstotliwości naturalnej. Zjawisko to nazywa się rezonansem. Dzięki rezonansowi stosunkowo słaba wibracja w jednym obiekcie może powodować silne wibracje w innym. Analogicznie termin rezonans jest również używany do opisania zjawiska, w którym oscylujący prąd elektryczny jest wzmacniany sygnałem elektrycznym o określonej częstotliwości.

Przykład rezonansu zapewnia silnik, który powoduje wibracje mebla w innej części tego samego domu. Drgania te występują, ponieważ częstotliwość naturalna mebli jest równa częstotliwości drgań ustawianych przez silnik. Mówi się, że meble rezonują z silnikiem. Rezonans można również zaobserwować w samochodzie, gdy pewna popielniczka Partan, na przykład wibruje, gdy samochód jedzie z określoną prędkością. Popielniczka rezonuje z wibracjami silnika przy tej prędkości.

Rezonans mechaniczny może wytwarzać wibracje wystarczająco silne, aby zniszczyć obiekt, w którym występują. Na przykład żołnierze maszerujący nad mostem mogą wytwarzać ekstremalne wibracje z częstotliwością naturalną mostu i roztrzaskiwać go na części. Z tego powodu żołnierze przebijają się, by przejść przez most. W 1940 r. Podmuchy wiatru w Puget Sound Narrows w Tacoma w stanie Waszyngton spowodowały, że most wiszący wibruje z naturalną częstotliwością i most zawalił się.

W muzyce rezonans służy do zwiększenia intensywności (głośności) dźwięku. Na przykład stosunkowo słabe wibracje wytwarzane na końcu rurki organowej powodują, że kolumna powietrza w rurze wibruje w rezonansie, znacznie zwiększając głośność dźwięku. Zasada ta dotyczy także głosu ludzkiego, w którym wibracje strun głosowych są wzmacniane przez wibracje rezonansowe w kanałach ustnych i nosowych.

Rezonans elektryczny służy do strojenia radiotelefonów i telewizorów. Strojenie polega na ustanowieniu obwodu o częstotliwości rezonansowej równej przydzielonej częstotliwości żądanej stacji.

6 0
3 years ago
Which statement describes a feature of Oracle sequences? Oracle sequences generate a character string that can be assigned to ta
mylen [45]

Answer:

An Oracle sequence uses the identity column property to automatically number rows.

Explanation:

An Oracle sequence is a tool that can be used to generate a number sequence. Oracle has the capacity to help you create an auto-number field by using one of its tools called sequence.

A sequence is an object in Oracle that is used to generate a number sequence for input to a table. This is required when you need to generate primary key values by the use of identity columns.

So, Oracle sequence can automatically number rows by the use of identity columns.

8 0
3 years ago
Other questions:
  • The first digital keyboard was the DX-7, introduced by the Yamaha company in 1983.
    15·1 answer
  • How do you take a screenshot on an iPhone?
    8·2 answers
  • What was bill gates first operating system he created?
    7·1 answer
  • To prepare a data character for transmission, a ____ bit is added to the beginning of the character and informs the receiver tha
    11·1 answer
  • What will be the value of x after the following code is executed? int x = 10; do { x *= 20; } while (x &lt; 5); A. 10 B. 200 C.
    14·2 answers
  • You were recently hired by a small start-up company. The company is in a small office and has several remote employees. You have
    15·1 answer
  • Describe an example of a very poorly implemented database that you've encountered (or read about) that illustrates the potential
    12·1 answer
  • Write if true or false
    11·1 answer
  • What is the missing part to have the output as 3 2 1 while count &gt;0 : print(count) count -= 1
    10·1 answer
  • How to transfer polygon from eth to polygon in ledger live
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!