Write a program for a procedure that passes the length, width and height as parameters, within a procedure output a user friendly message stating the volume of the cuboid.
input length, width and height from the user
pass the parameters to a procedure called volume
calculate the volume of the cubiod
output volume to user
Use the program structure below and complete:
def volume(length,width,height): # procedure
CODE HERE
# MAIN PROGRAM
CODE HERE
Write a program that will input three numbers from a user, it will use a function called high to identify and return the highest number and low to identify and return the lowest number.
input three numbers from the user
pass parameters to high, compare and return highest number
pass parameters to low, compare and return lowest number
output the highest and lowest numbers on screen
Use the program structure below and complete:
def high(num1,num2,num3): # function
CODE HERE
return highest
def low(num1,num2,num3): # function
CODE HERE
return lowest
# MAIN PROGRAM
CODE HERE
Write a program that will perform multiple mathematical operations and function as a calculator.
input two numbers (operands)
input users for their choice of mathematical operator (+-/*)
if + is entered then the addition function will be called to complete the calculation using the passed (data) operands and then return the result
similarly if -, / or * is entered as the operator an appropriate function is called.
the calculation will be constructed and displayed on screen for the user showing the result.
Use the program structure below and complete:
def add(num1,num2): # function
CODE HERE
return answer
def sub(num1,num2): # function
CODE HERE
return answer
def multinum1,num2): # function
CODE HERE
return answer
def div(num1,num2): # function
CODE HERE
return answer
# MAIN PROGRAM
CODE HERE
Write a program that will allow a user to input any word and it will output the total number of vowels in the word.
input a word
pass the word parameter to a function that will determine how many vowels are present in the word (A,E,I,O,U)
return the number as a parameter to main and output the number on the screen in a suitable message
Use the program structure below and complete:
def vowelcheck(word):
CODE HERE
return vowels
# MAIN PROGRAM
CODE HERE
Write a program that will convert one currency into another based on users input.
input amount of money in pounds they wish to convert
pass the pounds parameter to the function convertDollars, accepting the data for use
convert pounds to dollars with a conversion rate of 1 pound to 1.30 dollars
return the data held in dollars to the main procedure and output the conversion on the screen for the user
output message should make the conversion clear showing how many pounds give how many dollars
Use the program structure below and complete:
def convertDollars(pounds):
CODE HERE
return dollars
# MAIN PROGRAM
CODE HERE
Write a program that will either calculate & output the area of a triangle, square or a rectangle.
input the height and width of the shape
input which shape has been input (triangle, square, rectangle)
pass data as parameters to a suitable function
output area to the user with the associated calculation that has occured
Write aprogram that will take a set of numbers and calculate the range, mean and mediam of the given set.
use the getnumbers function in order to collect and store numbers from the user until 0 is entered
return the numbers from getnumbers to main
pass the numbers data as parameter to each function (Mode,Mean&Median)
calculate using the numbers passed the mean, mode and median and store them in a suitable data structure
return the mode, mean and median values to the main procedure
pass the values data as a parameter to the display procedure which will output the mode, mean and median on the screen to the user
Use the program structure below and complete:
def getnumbers(): # function
CODE HERE
return numbers
def getrange(numbers): # function
CODE HERE
return rangevalue
def getmean(numbers): # function
CODE HERE
return meanvalue
def getmedian(numbers) # function
CODE HERE
return medianvalue
def display(numbers,rangevalue,meanvalue,medianvalue) # procedure
CODE HERE
return
# MAIN PROGRAM
CODE HERE