Car insurance company XYZ considers various factors for calculating the price of their products for th tomers. The sales team has decided to provide certain discounts to attract more customers. They woul e to adjust the price according to the following table of information: 1. The base monthly rate is calculated as follows: Price of The Car 10k and below Base Monthly Rate 0.5% of the price 1% of the price 2% of the price 10k to 25k 25k and over 2. Based on the age of the driver, the following discounts are offered on the base monthly rate: Discount Applied Age 18 - 25 25 - 40 40 - 60 60 and over 0% 5 % 10 % 15 % 3. For students attending GMU, they have considered a promo code: MASONPATRIOTS2021 tha applies a $10 discount on the rate. 4. If any given customer had an accident, the final calculated price for them is increased by 20 percent. Also, the promo code is not applied. ite a function that provides a quote for a given driver, based on the rules listed above. The function ameters are price of the car, age of the driver and whether the driver has had any history of accidents; | the promo code. If the promo code is correct, the discount is applied. Otherwise, no discount is lied. Finally, the function should calculate and return the following value: The final monthly rate rounded to 2 decimal places. created by Kourosh T. Baghaei e function signature is as follows: :MonthlyRate(price, age, accident, promocode) return monthlyRate
Car insurance company XYZ considers various factors for calculating the price of their products for th tomers. The sales team has decided to provide certain discounts to attract more customers. They woul e to adjust the price according to the following table of information: 1. The base monthly rate is calculated as follows: Price of The Car 10k and below Base Monthly Rate 0.5% of the price 1% of the price 2% of the price 10k to 25k 25k and over 2. Based on the age of the driver, the following discounts are offered on the base monthly rate: Discount Applied Age 18 - 25 25 - 40 40 - 60 60 and over 0% 5 % 10 % 15 % 3. For students attending GMU, they have considered a promo code: MASONPATRIOTS2021 tha applies a $10 discount on the rate. 4. If any given customer had an accident, the final calculated price for them is increased by 20 percent. Also, the promo code is not applied. ite a function that provides a quote for a given driver, based on the rules listed above. The function ameters are price of the car, age of the driver and whether the driver has had any history of accidents; | the promo code. If the promo code is correct, the discount is applied. Otherwise, no discount is lied. Finally, the function should calculate and return the following value: The final monthly rate rounded to 2 decimal places. created by Kourosh T. Baghaei e function signature is as follows: :MonthlyRate(price, age, accident, promocode) return monthlyRate
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
I am having difficulties returning my function's final rate in an if-else statement. I did the code but when I run the program in terminal it is not giving me my output.
my code is below and the instructions are after.
Expert Solution
Step 1
we have revised code with the sample output
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 3 images
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY