Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. (4 points) Remember your sloth rental business from Lab 1 ? The pricing scheme is copied below for convenience: - There is a base

image text in transcribed
image text in transcribed
1. (4 points) Remember your sloth rental business from Lab 1 ? The pricing scheme is copied below for convenience: - There is a base fee of $250, regardless of how long the customer wants to rent the sloth. - The minimum time to rent the sloth is 2 hours. Each hour beyond the first 2 costs $80 per hour. - Memphis sales tax(9.75%) is added to get the final amount. In Lab 1, you wrote a program to compute the cost of a sloth rental, assuming that the user input for number of hours is always an integer that's at least 2. Let's now loosen that assumption to just "any integer." Modify your sloth rental.py program to behave like this: - If the user enters a negative number of hours, show an error message. - If the user enters 0 hours, show that there is no charge. - If the user enters 1 hour, charge the base fee of $250, plus tax. - If the user enters 2 or more hours, do the same calculations you did in Lab 1. All monetary amounts should be rounded to two decimal places. Example program run (underlined parts indicate what the user enters) How many hours would you like to rent a sloth? -9 What are you, some kind of time traveler? Example program run (underlined parts indicate what the user enters) How many hours would you like to rent a sloth? 0 The total cost will be $0.00. Example program run (underlined parts indicate what the user enters) How many hours would you 1 ike to rent a sloth? 1 The total cost will be $274.38. Example program run (underlined parts indicate what the user enters) How many hours would you like to rent a sloth? 3 The total cost will be $362.18

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

Big Data Systems A 360-degree Approach

Authors: Jawwad ShamsiMuhammad Khojaye

1st Edition

0429531575, 9780429531576

Students also viewed these Databases questions