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.

  1. 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.

  1. 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.

  1. A function called sphereArea that would return the surface area of a sphere when given the radius as an argument.

  1. A function called triArea that would return the area of a triangle given the length of its three sides as parameters.

  1. 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!