Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please help answer in phyton form FBTO015 STRUCTURED ALGORITHM & PROGRAMMING SEM JAN2021 LAB EXERCISE WEEK 9 (LAB 2) Learning Outcomes Upon completion of this

please help answer in phyton form

image text in transcribed

image text in transcribed

image text in transcribed

FBTO015 STRUCTURED ALGORITHM & PROGRAMMING SEM JAN2021 LAB EXERCISE WEEK 9 (LAB 2) Learning Outcomes Upon completion of this lab session, learners will be able to: 1. convert a mathematical formula into a valid Python statement, 2. implement selection and iteration structure in a Python program. Assessment #1 1. The program will compute and display information for a company which rents vehicles to its customers. For a specified customer, the program will compute and display the amount of money charged for that customer's vehicle rental. 2. The program will repeatedly prompt the user to enter the following four items for a given customer (in the specified order): a. The customer's classification code (a character) b. The number of days the vehicle was rented (an integer) c. The vehicle's odometer reading at the start of the rental period (an integer) d. The vehicle's odometer reading at the end of the rental period (an integer) 3. It will then process that customer information and display the results. It will halt when the user enters "Q" (or "q") instead of a classification code. 4. The program will compute the amount of money that the customer will be billed, based on the customer's classification code, number of days in the rental period, and number of miles driven. And display the total charge Sample Output Please enter your full name: Syed Muslim Jameel Please enter your rental classification code (1.e. B for budget, D for Daily, and w for weekly): W How many days did you rent your vehicle for? 21 What was your vehicle's initial odometer reading (in kms)? seee What was your vehicle's final odometer reading (in kms)? seee Summary: Name of vehicle renter: SYED MUSLIM JAMEEL Number of days vehicle rented: 21 Initial odometer reading on rented vehicle: 5000 kms Final odometer reading on rented vehicle: 8080 kms Number of kilometres driven during rental period: 3000 Final billing cost: $Bee.ee 1 UTP Charges Details Code 'B' (budget) base charge: $40.00 for each day mileage charge: $0.25 for each mile driven 1 JTP Charges Details Code 'B' (budget) base charge: $40.00 for each day mileage charge: $0.25 for each mile driven Hint 1: if classCode = 'B': # For budgeted rental baseCharge = 20 * daysRented kmCharge = 0.30 * kmDriven totalCharge = baseCharge + kmCharge Code 'D' (daily) base charge: $60.00 for each day mileage charge: no charge if the average number of miles driven per day is 100 miles or less; otherwise, $0.25 for each mile driven above the 100 mile per day limit. Hint 2: # Calculation of average Kms elif classCode == 'D': avgKmPerDay = kmDriven / days Rented driven per day during rental period baseCharge = 50 * daysRented if avgKmPerDay

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Knowledge Discovery In Databases

Authors: Animesh Adhikari, Jhimli Adhikari

1st Edition

3319132121, 9783319132129

More Books

Students also viewed these Databases questions