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]
2 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]2 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
You are a disgruntled employee with a master’s degree in computer sciences who was recently laid off from a major technology com
WARRIOR [948]

Answer:

If you know what you're doing, I'd suggest hacking into the company's website...

Explanation:

3 0
3 years ago
Q1) write a brief note on desktop computer.
morpeh [17]

Answer:

→A desktop computer is designed mainly as a single user computer to solve the tasks of the end user.

→ A laptop is a personal computer with a touchpad used to move a cursor on the screen.

Explanation:

.

6 0
2 years ago
You are a software engineer at a company where management routinely encourages you and your colleagues to use pirated software.
s2008m [1.1K]

Answer:

That’s highly illegal. You should notify them that it is illegal. And, if they continue, you should notify the legal team. If it continues, you either need to leave the company or notify the proper authorities.

7 0
2 years ago
How many responses does a computer expect to receive when it broadcasts an ARP request?why?
Alla [95]

Answer: The response that is expected when it broadcast an ARP request is one or zero.

Explanation: ARP request means Address Resolution Protocol which is a protocol responsible for the mapping of the IP(Internet protocol)address of a system to the MAC(Media Access Control) layer. Only one response is received only if the IP address is present in the ARP otherwise if the IP address does not matches then no response is returned.Thus only one or zero response can be received when a ARP request is process.

5 0
2 years ago
When Judy logged on the network, she faced the message requesting that she changes her password. So, she changed her password. B
jeka94

Answer:

Because reusing the old passwords possess security threats.

Explanation:

A password can be defined as a string of characters or words or phrases that are used to authenticate the identity of the user. It is also known as passcode and should be kept confidential. A password is used to access constricted systems, applications, etc.

A password or passcode is usually composed of alphabets, numbers, symbols, characters, alphanumeric, or a combination of these.

<u>In the given case, Judy was not able to change her passcode to the previous one because reusing old passwords is prohibited in any sites or systems. A system denies the user to reuse the old passwords for various reasons but most importantly due to security reasons. Though it is said that old passwords can be used after 100 times but seldom someone changes a password that much. All systems care for the security of their users thus they deny reusing old passcodes.</u>

6 0
3 years ago
Other questions:
  • Which connector is most commonly used to connect printers to desktop pc systems?
    10·1 answer
  • When using a wireless mouse, what is the most common port used for the transmitter? 
    7·1 answer
  • Will a tablecloth that is 155 cm long cover a table that is 1.6 m long?
    12·2 answers
  • Which of the following information should be included in audit documentation? a. Procedures performed. b. Audit evidence examine
    13·1 answer
  • Vpn stands for _____. very precise settings virtual private network virtual public network vice prestigious setup
    5·1 answer
  • Juan has performed a search on his inbox and would like to ensure the results only include those items with attachments which co
    14·2 answers
  • Transitive spread refers to the effect of the original things transmitted to the associate things through the material, energy o
    6·1 answer
  • You can resize a row in a table by dragging the ____.
    13·1 answer
  • Write a complete program that declares an integer variable
    7·1 answer
  • What's the commission payout for auto bill pay if sold with a ga?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!