Question: Write in python a program that has 5 functions. Name your functions based on their functionality. Avoid naming your function, funtion1, fucntion2, etc. For example,

Write in python a program that has 5 functions. Name your functions based on their functionality. Avoid naming your function, funtion1, fucntion2, etc. For example, a function that converts inches to centimeters may be named inchTocm.

Function 1: This function accepts 3 numbers. Calculate and return the lowest value. No print statements here. S o, if the function is given the numbers 22, 4, and 100, it will return 4.

Function 2: This function accepts the first name, the last name of a user and the number of dependents he or she has. Calculate the standard tax rebate that the user receives based on the number of dependents. The tax rebate is calculated as number of dependents multiplied by $2300. The calculated tax rebate value must be returned from the function. No print statements here.

Function 3: This function accepts as its parameter any number. The function will display the number followed by *****, followed by the number squared, followed by &&&&&, and followed by the number cubed. For example, if the parameter value is 5, the function will display 5***25&&&125. If the value entered is 2.8, the number squared is 7.84 and the number cubed is 21.95. Dont worry about displaying a certain set of digits after the decimal point.

Function 4: T his function accepts two whole numbers as its parameters and displays all the values between the first parameter and the second parameter with steps of 1. So, if the value of the first parameter is 5 and the value of the second parameter is 10, the function displays 5 6 7 8 9 10. If the first value is equal to or more than the second value, display FAIL. So, if the first parameter is 10 and the second parameter is 5, the function displays FAIL. Note, this function will have print statements.

Function 5: (Dont let the MATH bother you! You just have to convert the formula into a program statement. This function calculates and returns the distance an object falls due to gravity in a specific time. The formula is:Distance = * gravity * time2. The function accepts as parameters the value for gravity and the value for time the object has been falling.

The function returns the value of distance. Make sure to write code to show the usage of all of the functions you have created. Make sure to use input. For example, ask the user for 3 numbers and call function 1. For function 2, ask the user for the required input. Call function 3 with as many numbers as the user wishes to enter. You can ask the user of the number of times to call the function, or use a sentinel value to end the input. Call function 4 with input representing its parameter values. In your main function, use a loop to ask the user for a set of values for gravity and time and display the value for distance by calling function 5. For example, if the value of gravity is 9.8 and time is 10, distance will be 490 (1/2*9.8*10*10).

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!