python 5.2
There are three metro buses. Ask the user to enter the number of passengers each bus ferries. Call a function and send the number of passengers from each bus. The function should returns the total number of passengers. Then pass the total number of passengers to another function that calculates and returns the total fare earned. Assume that each passenger is charged $2.50 Then send the total fare earned to another function which deducts %50 of the total fare as operating cost and returns the remaining as net profit. display all relevant data at the end. Please note that this must be implemented using functions. The manual grading carries 30% of your final grade. Those who do not impelment it using functions will loose 30% of points. Mimir requirements: File name: Module5Homeowork2.py Test case 1: Please enter the number of passengers for bus1 :20 Please enter the number of passengers for bus2 :30 Please enter the number of passengers for bus3 :56 *********** There are total 106 passengers from three buses. The total fare earned is: $265.0 The net profit is: $132.5 *********** Test Case 2: Please enter the number of passengers for bus1 :40 Please enter the number of passengers for bus2 :50 Please enter the number of passengers for bus3 :30 *********** There are total 120 passengers from three buses. The total fare earned is: $300.0 The net profit is: $150.0 ***********
8 years ago 10
Purchase the answer to view it
- Python5.2code.docx
- Marketing at a hospital
- editing
- How far should the recovery site be from your organization?
- discussion board
- Why does this book pay so much attention to Gentiles? 5-7 sentences for a discussion question
- mixed financial accounting questions
- A famous quote by President Theodore Roosevelt was an old African proverb: “Speak softly and carry a big stick.” Roosevelt felt that the “big stick” was action. In an essay of approximately 500 words, explain how the imperialistic attitude of the Un
- goodwriter
- as discfussed
- Drawing Hydraulic Circuit Using AutoCad