Answered step by step
Verified Expert Solution
Question
1 Approved Answer
CAN ANYONE HELP ME WITH THIS PYTHON ASSIGNMENT? THANKS! COSC 1306 Assignment #9 Objective: Practice using tuples with dictionaries, functions, looping, and conditional execution to
CAN ANYONE HELP ME WITH THIS PYTHON ASSIGNMENT? THANKS!
COSC 1306 Assignment #9 Objective: Practice using tuples with dictionaries, functions, looping, and conditional execution to solve a problem. Description: In this assignment we will create a program that will perform calculations and count up the number of right triangles with integer length sides for a given integer perimeter Repeating this calculation, we will determine the perimeter that provides the maximum number of different integer-sided right triangles with the same perimeter For a right triangle with integer sides (a,b,c), the perimeter of the triangle is the sum of the sides p-atbtc. Given a specific perimeter, for example a perimeter of 12, there is only one possible triangle with integer sides -the classic (3, 4, 5) triangle. For a perimeter of 120, there are three possible triangles: (20, 48, 52), (24,45, 51), and (30, 40, 50). This is the maximum number of triangles for any perimeter value below 200 What is the perimeter value, less than 2018, that has the most possible triangles? What are the side lengths of those triangles? Your program must meet the following requirements 1. Include a multi-line comments at the top of the file with your name, assignment number PSID number, and the 2. Your program should use functions and good programming style to solve the problem. No user input is required 3. Your program should determine the perimeter, less than 2018, with the most possible integer- sided right triangles and output this perimeter 4. Your program should keep track of the possible triangles and output the triangles associated with the maximal perimeter in sorted order Hint: Test your program with a smaller limit (200) to confirm that your program works with the results that you are given Deadline: Saturday, November 24, 2018, 11:59PM Example Output: For a limit of 200 The perimeter of 120 gives a maximum number of 3 triangles. The triangles are: (20, 48, 52) (24, 45, 51) (30, 40, 50)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started