Answered step by step
Verified Expert Solution
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 discount to customers who reside in Arizona a "locals" discount a discount to customers from Colorado a "Broncos fan" discount and a $ price increase for customers from Rhode Island because a car with R I. plates cut him off one time, 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 argumentsparameters and returns not outputs the price after discount or extra charge. Back in your toplevel 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 guidelines, including names file function, variables that are descriptive of their role.
Part B
As punishment for giving a variable in your code a oneletter 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 argumentsparameters 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 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 guidelines throughout.
Step 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