Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Part A Isaiah's Ice Cream gives a 1 0 % discount to customers who reside in Arizona ( a locals discount ) , a 1

Part A
Isaiah's Ice Cream gives a 10% discount to customers who reside in Arizona (a "locals" discount), a 15% discount to customers from Colorado (a "Broncos fan" discount), and a $5 price increase for customers from Rhode Island (because a car with R. I. plates cut him off one time, 23 years ago).
Create a program that prompts the user for their state name and the total amount of their ice cream purchase. In it, create a method that accepts both of those pieces of information as arguments/parameters and returns (not outputs) the price after discount or extra charge. Back in your top-level code, output a message with an explanation of the customer's new total price. Customers from all other states pay regular price.
Be sure to follow PEP 8 guidelines, including names (file, function, variables) that are descriptive of their role.
Part B
As punishment for giving a variable in your code a one-letter name, your supervisor has given you a menial task: create a class to keep track of the company's refillable water coolers.
Begin by creating a class to the following specifications:
Attributes ("variables"):
Cooler location (for example, "break room" or "warehouse")
Remaining water (in gallons)
A constructor with arguments/parameters for each attribute
Methods:
A method to call when an employee fills their bottle. It reduces the remaining water by half a gallon
Replace supply, which resets the remaining water to 20 gallons
A method to change the location of the cooler, in case their decide to move it.
Next, write code at the top level (not inside the class) that creates at least two water cooler instances and then simulates some usage of each by calling all of the methods. It can ask the user for input or it can just run automatically and display the results.
Again, stick to PEP 8 guidelines throughout.

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 Fundamentals Concepts, Drivers & Techniques

Authors: Thomas Erl, Wajid Khattak, Paul Buhler

1st Edition

0134291204, 9780134291208

More Books

Students also viewed these Databases questions

Question

25.0 m C B A 52.0 m 65.0 m

Answered: 1 week ago