Implement a triangle class in python

Assignment Help Python Programming
Reference no: EM131050597

Project-

A printout showing the codes developed and outputs produced for the tests indicated. Deadline is strictly observed.

A. Implement a Triangle class in Python:

1. The triangle is defined by its three side lengths - a, b, and c.

2. The class includes methods that perform the following operations:

a. is_triangle - checks whether the given side lengths form a proper triangle;

b. area - returns the area of the triangle if properly formed; None otherwise;

c. perimeter - returns the perimeter of the triangle if properly formed; None otherwise;

d. a_angle, b_angle, c_angle - returns the vertex angle opposite to side a, side b, and side c, respectively, if the triangle is properly formed; None otherwise;

e. angles - returns the angles of the triangle;

f. __str__ - returns a string representation of a triangle object: side lengths, angles, perimeter, and area;

g. draw_triangle - draws a triangle of the given parameters using turtle. Test the Triangle class given the following data sets: (a, b, c) = (100, 100, 72), (100, 100, 100√2), (100, 50, 50).

B. Implement a Isosceles subclass of the Triangle class in Python:

1. The isosceles is defined by the side length - a - of the two equal sides and the angle formed by the two sides - angle -- in degrees.

2. The class includes or inherits methods that perform the following operations:

a. is_triangle - checks whether the given side lengths constitute a proper triangle;

b. area - returns the area of the triangle;

c. perimeter - returns the perimeter of the triangle;

d. a_angle, b_angle, c_angle - returns the vertex angle opposite to side a, side b, and side c, respectively;

e. angles - returns the angles of the triangle;

f. __str__ - returns a string representation of a triangle object: side lengths, angles, perimeter, and area;

g. draw_triangle - draws a triangle of the given parameters using turtle.

Test the Isosceles class given the following data sets: (a, angle) = (100, 72), (100, 90), (100, 60).

 C. Implement a PieChart class in Python:

1. The class includes or inherits a method that draws a pie chart of a given data set {(key, value)|1,2, . . ,n } using turtle:

a. The area of a slice of the pie chart is proportional to the percentage of an item value in the data set;

b. Each slice of the pie chart has a different color;

c. The pie chart has a legend that visually shows or relates the pie chart slices to their corresponding keys and values.

Test the PieChart class using the set of frequency of letters in "Words.txt" file -- {(letter, frequency)|1,2, . . ,n} -- you obtained in a previous exercise or project.

Reference no: EM131050597

Questions Cloud

Calculate the cumulative incidence of deaths : (a) normal weight, (b) slightly overweight, (c) moderately overweight and (d) greatly overweight. 57,145 deaths from cancer occurred in the population during the follow-up period. Calculate the cumulative incidence of deaths from cancer among the ..
Write a research proposal for a media and communication : ACX702 Communication Research methods - Research Proposal - Write a comprehensive research proposal for a media and communication-related research study you would like to undertake using Chapters 3 & 5 in the textbook as a guide.
Results for the four designs : All 40 balls were hit in a short period of time, during which the environmental conditions were essentially the same. The results for the four designs were as follow:
Write a seven page paper about who you are as a manger : Write a seven page paper about who you are as a manger, what you believe in (in the eyes of a manager) and what kind of organization you will be effective in as a manager.
Implement a triangle class in python : CSc 11300 Spring 2016 Programming Languages. Implement a Triangle class in Python: The triangle is defined by its three side lengths - a, b, and c. The class includes methods that perform the following operations: is_triangle - checks whether the giv..
Cumulative incidence of chicken pox : None of those lost to follow-up had developed chicken pox prior to becoming lost. Assume that you can get chicken pox only once. What is the cumulative incidence of chicken pox in this population during the one-year period from January 1st through..
Impact of new accounting pronouncements in the footnotes : 1. Companies disclose the impact of new accounting pronouncements in the footnotes to their financial statements(Usually in the Summary of Significant Accounting Policies).
Difference between coke and new coke : What are the null and alternative hypothesis? What is the decision rule or at what value would you reject H0? What is the calculated test statistic?
Explain how you would overcome potential barriers : Identify two potential barriers that could occur in your communication scenario and then explain how you would overcome them. Write your answer(s) below.

Reviews

Write a Review

Python Programming Questions & Answers

  1 why is biodiversity importantnbsp discuss the ways in

1 why is biodiversity important?nbsp discuss the ways in which the value may be assigned to biodiversity. based on your

  We would like to implement the lexical order

We would like to implement the lexical order for lists. For simplicity, we only consider lists of numbers, where , >= have their usual meaning.

  Create a python program that allows user enter class name

Create a Python program that allows user enter class name, faculty name, name of each student, and letter grade each student earned.

  Implement your algorithm in python

Write an algorithm in structured English (pseudocode) that describes the steps required to perform the task specified and reinforce topic material related to the programming work cycle, and the input, processing, output program structure.

  The managing director of aussie best car abc has invited

the managing director of aussie best car abc has invited you to build a new computer system for them in python. the abc

  Python programming to solve this problem

Write a statement that adds 1 to deansList and prints studentName to standard out if gpa exceeds 3.5.

  Python code for grabbing data from yahoo finance

I am new to Phython. Using Spyder IDE Simple code. It is not recognizing by Data file see line 33 - The purpose of assignment is to get you familiar with the Python.

  Design a prgram using python

Design a prgram USING PYTHON that students can use to calculate what score they need on final exam to get a certan final grade for a course.

  Write a program that accepts as input a sentence

Write a program that accepts as input a sentence in which all of the words are run together but the first character of each word is uppercase. Convert the sentence to a string in which the words are separated by space and only the first word start..

  Write a function rmduplic(l), where l is any list

Write a function rmDuplic(L), where L is any list. The function should return a list M that contains the same items as L, except that repetitions (duplicates) have been removed: only the first occurrence of each entry is kept (i.e., order is prese..

  Create a cheat commands in the game so player can teleport

Create a cheat commands in the game so player can teleport to any location in the map - The first four tasks in this section can be completed by modifying only the code within the ProcessStatement() and Game() functions. This section typically requ..

  Write a python program that reads a dumbbasic program

You should write a Python program that reads a DUMBBASIC program from standard input1, and prints the results of executing that program to standard output.

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