Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using python, fill in the missing code to complete the attached program. Fill in the code in the following order: 1) Fill the function definitions

Using python, fill in the missing code to complete the attached program. Fill in the code in the following order:

1) Fill the function definitions

2) Fill in the missing code in main().

#Lab Assignment 5: Fill in the missing code

#Name:

import math

#define functions (1 point each)

#return type: float

#Parameters: 2 floats(l and w)

#This function returns the area of a rectangle with the given dimensions

def RectangleArea(l,w):

#return type: float

#Parameters: 2 floats(l and w)

#This function returns the perimeter of a rectangle with the given dimensions

def RectanglePerimeter(l,w):

#return type: float

#Parameters: 1 floats(r)

#This function returns the area of a circle with the given radius

def CircleArea(r):

#return type: float

#Parameters: 1 floats(r)

#This function returns the circumference of a circle with the given radius

def CircleCircumference(r):

#return type: None

#Parameters: None

#This function displays an introduction

def Intro():

#return type: None

#Parameters: 4 floats(rectArea, rectPer, circArea, circum)

#This function displays the four values passed to it

def PrintInfo(rectArea, rectPer, circArea, circum ):

#return type: float

#Parameters: None

#This function prompts the user for a length(must be positive) and returns it

def GetLength():

#local variables

#float length

#return type: float

#Parameters: None

#This function prompts the user for a width(must be positive) and returns it

def GetWidth():

#local variables

#float width

#return type: float

#Parameters: None

#This function prompts the user for a radius(must be positive) and returns it

def GetRadius():

#local variables

#float radius

def main():

#declare and initialize variables

#float mylength, mywidth, myradius, myrectarea, myrectper,

#mycircarea, mycircum

mylength = 0.0

mywidth = 0.0

myradius = 0.0

myrectarea = 0.0

myrectper = 0.0

mycircarea = 0.0

mycircum = 0.0

#call(invoke) Intro function (1 pt)

#call a function to prompt for a length and store in mylength (1 pt)

#call a function to prompt for a width and store in myWidth (1 pt)

#call a function to prompt for a radius and store in myradius (1 pt)

#invoke a function to store the area of the rectangle in myrectarea (1 pt)

#invoke a function to store the perimeter of the rectangle in myrectper

#(1 pt)

#invoke a function to store the area of the circle in mycircarea (1 pt)

#invoke a function to store the circumference of the circle in mycircum

#(1 pt)

#call a function to display the results of the above calculations(1 pt)

#call a function to display the area of a rectangle with dimensions 10 x 15

#(1 pt)

#call a function to display the area of a circle with radius 8

#(1 pt)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2015 Porto Portugal September 7 11 2015 Proceedings Part 3 Lnai 9286

Authors: Albert Bifet ,Michael May ,Bianca Zadrozny ,Ricard Gavalda ,Dino Pedreschi ,Francesco Bonchi ,Jaime Cardoso ,Myra Spiliopoulou

1st Edition

ISBN: 3319234609, 978-3319234601

More Books

Students also viewed these Databases questions

Question

7. Understand the challenges of multilingualism.

Answered: 1 week ago