Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PLEASE HELP Lab 4 Lab 4 In this lab you will write a program that will do the following - It will take as input
PLEASE HELP
Lab 4 Lab 4 In this lab you will write a program that will do the following - It will take as input the number of miles of taxi cab ride, after the prompt "Please input the number of miles for the ride: ". - it will calculate the cost by the following rules - there is a base charge of $2.50. for the first 5 miles the charge is $4.00 per mile. For example if the distance is 3.5 miles the charge would be 250 + 35 * 4.00 = $16.50 --for rides beyond the 5 miles up to 10 miles, the charge is $3.00 per mile beyond the 5 miles. Eg for a ride of 7 miles, the charge would be 2.50 + 5* 4.00 + (7-5) * 3.00 = $28.50 - For rides more beyond 10 miles, the charge for the miles beyond 10 miles is $2.00. For example for 20 miles the charge is 2.50 +5 * 4.00 + (10-5) * 3.00 + (20 - 10) * 2.00 = $57.50 - The program should output the following with the correct charge Please enter your input The charge for the ride is - You must include an appropriate header in the source code in the format of previous labs. You must upload the file with the source python code lab4.py, and screenshots with inputs 6, 11, 17, and 21 You must turn in hard copies of the above as well Deadline: 10 am, Tuesday February 4. Blackboard will not accept late submissionsStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started