Question 3 (50 points) You have been hired by a local grocery store in order to update and expand the CashRegister Class that was discussed in class. Your task is to update class by adding functionality to it such that it will compute the total sales by all customer in a whole day, reset all variables after the store closes every d show the customer count per day, every day. In order to accomplish your task you need to do two smaller tasks: 1. Update the existing methods presented during lecture time, as needed, to accomplish the task described, above. 2. In order to help you further, you need to write 4 new methods, as follows: • addCustomerCount () - increments the customer count at the end of every customer sale end • getCustomerCount () - gets/returns the customer count; to be invoked at the end of every day • getSalesTotal() -gets/returns the total customer sales for all customers; to be invoked at the end of every day • resetSales () - clear daily instance variables that need to be cleared at the end of every day Important remarks: 3. You MUST USE the exact same methods names above, and to keep all the methods and their names that were discussed in lecture 4. Notice that the new methods do not take any input parameters 5. You may call your new instance variables using any names that you choose 6. Your updated CashRegister class will be tested by data of our choosing using the same method names mentioned in class and the new ones ab and therefore, it is important that you use the same method names and that they do the tasks described, above. Test the above class by: • Creating one CashRegister object; add two days sales. • For First day add sales for two customers. • Customer 1: items = 3 and Total = 5.40 • Customer 2: items = 4 and Total = 10.00 • For Second day add sales for 3 customers. • Customer 1: items = 2 and Total = 22.45 • Customer 2: items 5 and Total = 106.50 • Customer 3: items = 1 and Total = 20.00 A Sample output resulting from running the above test code is shown below: Day 1 sales Customer 1 Items - 3 Total - 5.4e Customer 2 Items - 4 Total - 10.ee Day Sales -15.40 Total Customers- 2 Edit Day 2 sales Customer 1 Items - 2 Total - 22.45 Customer 2 Items - 5 Total - 106.5e Customer 3 Items - 1 Total - 20.ee Day Sales -148.95 Total Customers- 3

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter13: Overloading And Templates
Section: Chapter Questions
Problem 10PE
icon
Related questions
Question

Please solve this simple python program. You will find the question explained and show what should the output looks like. On the another image, you can find the incompleted code that you need to complete as it is required on the question.

Edit M
Question 3 (50 points)
You have been hired by a local grocery store in order to update and expand the CashRegister Class that was discussed in class. Your task is to update
class by adding functionality to it such that it will compute the total sales by all customer in a whole day, reset all varíables after the store closes every d
show the customer count per day, every day. In order to accomplish your task you need to do two smaller tasks:
1. Update the existing methods presented during lecture time, as needed, to accomplish the task described, above.
2. In order to help you further, you need to write 4 new methods, as follows:
• addCustomerCount () - increments the customer count at the end of every customer sale end
• getCustomerCount () - gets/returns the customer count; to be invoked at the end of every day
• getSalesTotal() - gets/returns the total customer sales for all customers; to be invoked at the end of every day
• resetSales () - clear daily instance variables that need to be cleared at the end of every day Important remarks:
3. You MUST USE the exact same methods names above, and to keep all the methods and their names that were discussed in lecture
4. Notice that the new methods do not take any input parameters
5. You may call your new instance variables using any names that you choose
6. Your updated CashRegister class will be tested by data of our choosing using the same method names mentioned in class and the new ones ab
and therefore, it is important that you use the same method names and that they do the tasks described, above.
Test the above class by:
• Creating one CashRegister object; add two days sales.
• For First day add sales for two customers.
• Customer 1; items = 3 and Total = 5.40
• Customer 2: items = 4 and Total = 10.00
• For Second day add sales for 3 customers.
• Customer 1: items = 2 and Total = 22.45
Customer 2: items = 5 and Total = 106.50
• Customer 3: items = 1 and Total = 20.00
A Sample output resulting from running the above test code is shown below:
Day 1 sales
Customer 1
Items - 3
Total - 5.40
Customer 2
Items - 4
Total - 10.ee
Day Sales -15.40
Total Customers- 2
Edit
Day 2 sales
Customer 1
Items - 2
Total - 22.45
Customer 2
Items - 5
Total - 106.50
Customer
Items - 1
Total - 20.ee
Day Sales -148.95
Total Customers- 3
Transcribed Image Text:Edit M Question 3 (50 points) You have been hired by a local grocery store in order to update and expand the CashRegister Class that was discussed in class. Your task is to update class by adding functionality to it such that it will compute the total sales by all customer in a whole day, reset all varíables after the store closes every d show the customer count per day, every day. In order to accomplish your task you need to do two smaller tasks: 1. Update the existing methods presented during lecture time, as needed, to accomplish the task described, above. 2. In order to help you further, you need to write 4 new methods, as follows: • addCustomerCount () - increments the customer count at the end of every customer sale end • getCustomerCount () - gets/returns the customer count; to be invoked at the end of every day • getSalesTotal() - gets/returns the total customer sales for all customers; to be invoked at the end of every day • resetSales () - clear daily instance variables that need to be cleared at the end of every day Important remarks: 3. You MUST USE the exact same methods names above, and to keep all the methods and their names that were discussed in lecture 4. Notice that the new methods do not take any input parameters 5. You may call your new instance variables using any names that you choose 6. Your updated CashRegister class will be tested by data of our choosing using the same method names mentioned in class and the new ones ab and therefore, it is important that you use the same method names and that they do the tasks described, above. Test the above class by: • Creating one CashRegister object; add two days sales. • For First day add sales for two customers. • Customer 1; items = 3 and Total = 5.40 • Customer 2: items = 4 and Total = 10.00 • For Second day add sales for 3 customers. • Customer 1: items = 2 and Total = 22.45 Customer 2: items = 5 and Total = 106.50 • Customer 3: items = 1 and Total = 20.00 A Sample output resulting from running the above test code is shown below: Day 1 sales Customer 1 Items - 3 Total - 5.40 Customer 2 Items - 4 Total - 10.ee Day Sales -15.40 Total Customers- 2 Edit Day 2 sales Customer 1 Items - 2 Total - 22.45 Customer 2 Items - 5 Total - 106.50 Customer Items - 1 Total - 20.ee Day Sales -148.95 Total Customers- 3
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Knowledge Booster
Random Class and its operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning