Question: Question 3 Simple Programming Problems using Python Define the following requirements as functions in Python. Note: maximum award of 2 marks for each. A function
Question 3 Simple Programming Problems using Python
Define the following requirements as functions in Python.
Note: maximum award of 2 marks for each.
- A function called menu which prints the text string "Menu Choice". The function does not pass any data back and does not accept any data as parameters.
- A function called getDiscount which will simply prompt the user to input a discount rate that it passes back to the calling function or program. The function does not accept any data as parameters.
- A function called sphereArea that would return the surface area of a sphere when given the radius as an argument.
- A function called triArea that would return the area of a triangle given the length of its three sides as parameters.
- A function called sumArray that would return the sum of the numbers in an array passed to it as an argument.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
