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
A direct-mapped cache holds 64KB of useful data (not including tag or control bits). Assuming that the block size is 32-byte and
Cerrena [4.2K]

Answer:

A) Number of bits for byte = 6 bits

B) number of bits for index = 17 bits

C) number of bits for tag = 15 bits

Explanation:

Given data :

cache size = 64 kB

block size = 32 -byte

block address = 32 -bit

number of blocks in cache memory  

cache size / block size = 64 kb / 32 b = 2^11 hence the number of blocks in cache memory = 11 bits = block offset

A) Number of bits for byte

log _{2} (6)^2 = 6  bits

B) number of bits for index

block offset + byte number

= 11 + 6 = 17 bits

c ) number of bits for tag

= 32 - number of bits for index

= 32 - 17 = 15 bits

5 0
2 years ago
Class 00 rubber gloves are used when working with voltages less than​ _____.
Radda [10]
Answer: 500 volts AC, 750 volts DC
Class 00 rubber gloves are given the color "beige" based on the color code of rubber gloves.
The proof test voltage for this class of rubber gloves is 2500 volts of AC voltage and 10000 volts of DC voltage
4 0
2 years ago
Which is the best information to determine an athlete's abilities and needed areas of improvement?
katen-ka-za [31]

Answer:

4

Explanation:

7 0
2 years ago
Read 2 more answers
Software that organizes, manages, and processes business data, such as data concerned with inventory, customers, and vendors, is
adoni [48]

Answer:

c) data management software

Explanation:

Software that organizes, manages, and processes business data, such as data concerned with inventory, customers, and vendors, is called data management software.

5 0
3 years ago
How can one become a world scientist?
Lynna [10]
No need to woory abt age !!! In today's competitive grant world, this phenomenon is exacerbated. It is dangerous to one's funding to go against the trend, and if there is a lab to support and mouths to feed, the disincentives are great. This phenomenon stifles creativity, perhaps far more than biological age does. 
<span>While it is not frequently acknowledged either in the popular press or in scientific literature, a significant fraction of scientific discovery is the result of serendipity (or to put it more bluntly, luck). From the discovery of penicillin by Fleming to the discovery of new ionization techniques such as MALDI that power modern mass-spectrometry based proteomic research, luck has frequently played a big role. Such discoveries are generally attributed to hard work and genius, rather than to luck. Doing so gives the “genius” too much credit and luck too little.
</span><span>Risk taking is where most of the big discoveries in science lie. so takerisks.
</span>enjoy  always specially when you r  working and learn to say no
Learning to say “no” is particularly important for young faculty, who find themselves barraged with such requests, and who can easily get sucked into full-time committee duties. It is wise to step back frequently and ask, “overall, is this work I am doing fun?” If the answer is no, perhaps it is time to revisit and consider diving into a new area.
<span>Note the distinction in this guideline from: “learn to write and present well.”
</span><span>Understanding and conveying the big picture for one's work is perhaps the greatest challenge facing young scientists
</span>That's all I can give.
8 0
2 years ago
Read 2 more answers
Other questions:
  • Which of the below statements describes the nature of HTML elements - check as many as apply
    6·1 answer
  • The action in which a router divides and forwards incoming or outbound message traffic to multiple links is known as
    15·1 answer
  • Write a Java program in jGRASP that creates a 2D integer array of 5 rows and 20 columns, fills it with increasing integer values
    13·1 answer
  • The _device provides a means of communication between a computer and outer world.​
    14·1 answer
  • A foreign exchange student brought his desktop computer from his home in Europe to the United States. He brought a power adapter
    9·1 answer
  • URGENT!!! Steve wants to change shooting and exposure settings while on his photo shoot. Which camera part will allow him to do
    12·2 answers
  • Numdu
    7·1 answer
  • Recently, Walmart offered a wireless data contract based on bandwidth used, with a minimum monthly charge of $42 for up to 5 gig
    15·1 answer
  • What help in executing commands quickly
    5·1 answer
  • Document accurately describes the differences between servers and computers and between local and wide area networks. Document p
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!