Triangle classification algorithm

Assignment Help Basic Computer Science
Reference no: EM131406763

Please see the attachment for algorithm. We need to use Python for this short programming assignment. 

For this assignment, you need to create a function that implements the Triangle Classification Algorithm. The algorithm has a lot of steps in it, but each step is simple. We have covered enough material to implement this. 

The Triangle Classification Algorithm accepts three integer lengths and it returns a 1, 2, 3, or 4. The three lengths represent possible lengths to the sides of a triangle. Returning a 1 means that the lengths would form a scalene triangle. Returning a 2 means that the sides would form an isosceles triangle. Returning a 3 means that the sides would form an equilateral triangle. Returning a 4 means that the sides cannot form a triangle. For example, sides 1, 1, and 10 cannot form a triangle.

Below you will find a control flow graph of the algorithm. The brackets in the graph [ and ] are just there as a means of referencing each condition. Also, the || symbol is or. The top oval says, "Read i, j, k". These variables should be passed in as parameters to your function. The second oval is equivalent to

if i <= 0 or j <= 0 or k <= 0

Everything else on the chart should be easy to understand, but ask questions if needed.

Write a function for the implementation of the Triangle Classification Algorithm. Also, write a program that uses the function. This program should ask the user to enter the three lengths, and it returns the result of calling the function.

Reference no: EM131406763

Questions Cloud

Enabling aging and scavenging on the domain controllers : The Sr. network Administrator has tasked with you enabling aging and scavenging on the domain controllers. In your own words, provide instructions on how to enable aging and scavenging?
Total sales for a zip code for a specific zip code : Develop a PL/SQL anonymous block that displays the total sales for a zip code for a specific zip code. You may use any of your zip codes you wish.
What is the selectivity of an equality predicate on key : CSC 553 Advanced Database Topics Assignment. Consider the relation r (Key, Name, Address). The relation takes 200 blocks on disk and holds 10000 tuples. What is the selectivity of an equality predicate on Key
Managing threats and opportunities of open corporation : Discuses websites which contain articles and information in the area of Management. The articles written on these websites are based on secondary information. The Authenticity of source is not confirmed, so these content cannot be used as a sourc..
Triangle classification algorithm : For this assignment, you need to create a function that implements the Triangle Classification Algorithm. The algorithm has a lot of steps in it, but each step is simple. We have covered enough material to implement this.
Is it role of government to provide incentives to business : MBA 665- Is it the role of government to provide incentives to business? Why or why not? Do you agree with Michigan's decision to extend tax credits in the manner it has? Why or why not?
Do you believe that tonys family should be part of treatment : When speaking to the juvenile justice probation officer, Tony stated that drinking and marijuana was not a serious issue and that his parents did it all the time. With this statement, the juvenile probation officer realized that this was not a one..
Is lsb watermarking robust against attacks : Is LSB watermarking robust against attacks? If yes, explain. If not, why not? You can choose specific watermark attacks to explain your answer.
What entities are identified in the previous scenario : Based on the case scenario and your answers to a, b, and c, prepare an entityrelationship diagram. Be sure to specify the cardinalities for each relationship.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd