Question
This week were going to demonstrate our knowledge of Python object oriented programming concepts by creating a simple cash register program. Your program must have
This week were going to demonstrate our knowledge of Python object oriented programming concepts by creating a simple cash register program.
Your program must have a header. Your program must have a welcome message for the user. Your program must have one class called CashRegister.
Your program will have an instance method called addItem which takes one parameter for price.
The method should also keep track of the number of items in your cart. Your program should have two getter methods. getTotal returns totalPrice getCount returns the itemCount of the cart Your program must create an instance of the CashRegister class.
Your program should have a loop which allows the user to continue to add items to the cart until they request to quit. Your program should print the total number of items in the cart.
Your program should print the total $ amount of the cart. The output should be formatted as currency. Be sure to investigate the locale class.
You will need to call locale.setlocale and locale.currency.
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