Question: program: python pycharm Purpose: Solve a problem by writing multiple functions that perform different subtasks, and combining their use to solve a larger problem, also

 program: python pycharm Purpose: Solve a problem by writing multiple functions

that perform different subtasks, and combining their use to solve a larger

program: python pycharm

Purpose: Solve a problem by writing multiple functions that perform different subtasks, and combining their use to solve a larger problem, also to practice documenting functions. Degree of Difficulty: Moderate Siblings John and Jane want to buy their first dog, sadly. COVID has made selling lemonade difficult. Fortu- nately, both John and Jane are excellent Fortnite players, and have started charging other players to carry them to victory. However, they weren't sure about what their hourly rate of pay was. Your task is to write a Python program that calculates and displays the hourly pay rate for the youths after taking their effort into consideration. To accomplish this, you will need to write three Python functions: time, revenue, and rate_of_pay. The time function should take parameters n_games (the number of games played), time_per_game (average length of a game in minutes). and return the total time spent playing Fortnite. The total time is: total_time = number of games x time per game. The revenue function should take parameters tips (the amount of money donated by grateful players). n_players (the number of players escorted). price_per_player (the selling price for carrying one player) and return the total amount of money earned. The total money earned is: total_revenue = tips + money earned from players escorted The rate_of_pay function determines the net profit (net money earned) by the youth. It should: . call time and revenue and use their return values to compute the rate of pay earned by the siblings: return the rate of pay for each sibling in dollars per hour. The parameters of the rate_of_pay function should be chosen so that they provide the necessary infor- mation required to call the cost and revenue functions. The rate of pay is: rate of pay total_revenue total_time You must now test your program by preparing three examples of number of players escorted, price per player, number of games, average game length, and tips in advance so that you can judge whether your program is correct . Write code to ask the user for all five of these inputs, then display the cost, revenue. and pay rate of each prepared example to the console. Copy the console output from each of your three testing example into a text file and hand that text file in (see "What to Hand In' below). You may assume that the user supplies valid input from the console, that is, a positive number for all the parameters. See the sample run on the next page. Sample Run Here is an example of how your program's console output might look. Green text was entered by the user: blue text came from data returned by the function. How many games were played?: 60 What was the average length of a game (in minutes)?: 20 How many players were escorted?: 80 How much did each player pay (in dollars)?: 10.00 How much money was received in tips (in dollars)?: 35.60 Revenue: $835.60 Time: $20.0 Pay Rate: $41.78

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!