Complete the function so it prints the sum of its arguments

Assignment Help Python Programming
Reference no: EM132382483

Question

Complete the function asn2_1() so it prints the sum of its arguments

Complete the function asn2_2() so it calculates the average of its arguments and returns the average rounded to 2 decimal places.

Complete the function asn2_3() so it returns the area of a pizza, rounded to two decimal places. It will take one parameter -- the diameter of the pizza (assume the pizza is round).

Complete the function asn2_4() so it draws a rectangle. The function should take five parameters: a turtle, the length of the horizontal side, the length of the vertical side, the x location of the bottom left corner, and the y location of the bottom left corner.

Complete the statements in main() according to the directions in the code:

Add commands to the loop (for diameter in [10, 12, 16]) to calculate the areas of 10, 12, and 16 inch pizzas (using asn2_3()) and print those results.

Add commands to draw four rectangles using asn2_4()

The code is as follows:

import turtle

def asn2_1(num1, num2, num3):

'''Prints (does not return) the sum of three numbers'''

def asn2_2(??num1, num2, num3, num4, num5):

'''Returns (does not print) the average of five intergers'''

def asn2_3(d):

'''Returns the area of a pizza. The parameter is the pizza's diameter.'''

#Write function asn2_4() to draw rectangles

d?ef asn2_4(t, hlen, vlen, x, y):

'''asn2_4 takes the following parameters:

a turtle and 4 intergers; the integers are the length of the horizontal side, the length of the vertical side, x position of lower left corner, y position of lower left corner.'''

def main():

'''Change only the statements you are directed to change below'''

asn2_1(10, 12, 14) #Do not change this statement

average = asn2_2(10, 12, 14, 16, 18) ???#Do not change this statement

print("The average is", average) #Do not change this statement

for diamter in [10, 12, 16]:

#Add commands to call asn2_3() and print the areas of 10, 12, and 16 inch pizzas

wn = turtle.Screen() #Do not change this statement

jack = turtle.Turtle() #Do not change this statement

#Add commands to draw 4 rectangles using asn2_4() and turtle jack

wn.exitonclick() #Do not change this statement

main()

Reference no: EM132382483

Questions Cloud

Write a program to collect information for two payees : Write a program to collect information for two payees including the following information about them. Create variables, store the information for the two.
Overseas customer and accepting the special order : Suppose there is not enough idle capacity to produce all of the units for the overseas customer and accepting the special order would require cutting back
Implement a method to perform basic string compression : Implement a method to perform basic string compression using the counts of repeated characters. You can assume string has only uppercase and lowercase letters.
Find the largest palindrome made from the product : Find the largest palindrome made from the product of two three-digit numbers using a Python code. Afterward, write brief explanation walking through your code.
Complete the function so it prints the sum of its arguments : Complete the function asn so it calculates the average of its arguments and returns the average rounded to 2 decimal places.
HSA 5923 Health Services Administration Capstone Project : HSA 5923 Health Services Administration Capstone Project Assignment, Homework Help, Florida National University, USA - Capstone Description of the Project
How to find the subset of n elements using a stack s : How to find the subset of n elements using a Stack S and a Queue Q using Python? The response paper should be in APA format.
Create a list then using a loop populate the list : Create a list then, using a loop, populate the list with N elements. Set each list element to the index multiplied by 10.
Calculate the sum of each value of n squared : Calculate the sum of each value of N squared from 0 up to and including N. The response paper should be in APA format, double spaced, hand-written.

Reviews

Write a Review

Python Programming Questions & Answers

  Computing and storage infrastructure design

Computing and storage infrastructure design, and Information integration - A Python scrip file with the name ‘practice_locator.py' will contain this RESTful

  Write a python program that prompts the user to enter

Write a Python program that prompts the user to enter an integer and reports whether the input was even or odd.The program must use a while loop.

  Enter an amount as a floating-point value representing

The program lets the user enter an amount as a floating-point value representing a total dollars and cents, and then outputs a report listing the monetary.

  Provide python program to solve a simple payroll calculation

Provide Python program to solve a simple payroll calculation. Calculate the amount of pay, given hours worked, and hourly rate.

  Program using a loop that displays the projected semester

Write your program using a loop that displays the projected semester tuition for the next 7 years - You should then display the actual year

  What is the value of y after the following code is executed

Which is the statement that declares and initialises with zero a two dimensional array variable m with 3 rows and 4 columns?

  Create an application that displays he number of millimeters

Create an application that displays he number of millimeters that the ocean will have risen each year for the next 25 years.

  The program should use a boolean= valued function

Write a program that accepts a word as input and determines wehther or not it has three consecutive letters in the alphabet. The program should use a Boolean= valued function named isTripleConsecutive that accepts an entire word as input.

  Design a python program that prompts the user to enter

Design a PYTHON program that prompts the user to enter a number and then you will build a multiplication table of that size.

  Design and implementation of your demonstration system

ICT705 - Data and System Integration - University of the Sunshine Coast - write a report explaining the theory underlining the key concepts around the design

  Write a python function that accepts the number of feet

Write a python function that accepts the number of feet and head as input as returns the number of rabbits and number of chickens.

  Write a function to return the reverse complement of a dna

In the DNA double helix, two strands twist together and "face" each other. The two strands are reverse-complementary, i.e., reading one strand.

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