You have been hired by a local grocery store in order to update and expand the CashRegister Class that was discussedin dass. Yourtaskis to update t class by adding functionality to it such that it will compute the total sales by all customer in a whole day reset all variabl es after the store closes every day, and showthe customer count per day, every day In order to accomplish your taskyou needto do two smaller tasks: 1. Update the exi sting methods presented during lecture time, as needed, to accomplish the task described, above. 2 In order to help you further, you need to wite 4 new methods, as follows: • addCustomerCount () – increments the customer count at the end of every customer sale end getCustomerCount () – gets/retums the customer count, to be invoked at the end of every day • getSalesTotal () – gets/retums 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 theirnames that were discussedin lecture 4. Notice that the new methods do not take any input parameters 5. You may call your newinstance variables using any names that you choose 6. Your updated CashRegister dlass will betested by data of our choosing using the same method names mentioned in class and the new ones above, and therefore, it is important that you use the same method names and that they do the tasks described, above. Est the abov e dass by: • Crating one CashRegister object, add two days sales. • For First day add sales for two customers. • ustomer 1: items = 3 and Total = 5.40 • Customer 2 items = 4 and Total = 10.00

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
A Sample output resulting from running the above test code is shown below:
Day 1 sales
Customer
Items - 3
Total - 5.40
Customer 2
Items = 4
Total
= 10.00
Day Sales -15.4e
Total Customers- 2
Day 2 sales
.....
Customer 1
Items - 2
Total - 22.45
Customer 2
Items - 5
Total - 106.50
Customer 3
Items - 1
Total - 20.0e
Day Sales -148.95
Total Customers= 3
Transcribed Image Text:A Sample output resulting from running the above test code is shown below: Day 1 sales Customer Items - 3 Total - 5.40 Customer 2 Items = 4 Total = 10.00 Day Sales -15.4e Total Customers- 2 Day 2 sales ..... Customer 1 Items - 2 Total - 22.45 Customer 2 Items - 5 Total - 106.50 Customer 3 Items - 1 Total - 20.0e Day Sales -148.95 Total Customers= 3
You have been hired by a local grocery store in order to update and expand the CashRegister Class that was discussedin class. Yourtaskis to update the
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
day, and showthe customer count per day, every day In order to accomplish your taskyou needto 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 wite 4 new methods, as follows:
• addCustomerCount () – increments the customer count at the end of every customer sale end
• getCustomerCount () - gets/retums the customer count; to be invoked at the end of every day
getSalesTotal () - gets/retums 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 theirnames that were discussedin lecture
4. Notice that the new methods do not take any input parameters
5. You may call yournewinstance variables using any names that you choose
6. Your updated CashRegister class will betested by data of our choos
using the same method names mentioned in class and the new ones
above, and therefore, it is important that you use the same method names and that they do the tasks described, above.
est the abov e class by:
• Creating one CashRegister object; add two days sales.
• For First day add sales fortwo 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
Transcribed Image Text:You have been hired by a local grocery store in order to update and expand the CashRegister Class that was discussedin class. Yourtaskis to update the 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 day, and showthe customer count per day, every day In order to accomplish your taskyou needto 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 wite 4 new methods, as follows: • addCustomerCount () – increments the customer count at the end of every customer sale end • getCustomerCount () - gets/retums the customer count; to be invoked at the end of every day getSalesTotal () - gets/retums 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 theirnames that were discussedin lecture 4. Notice that the new methods do not take any input parameters 5. You may call yournewinstance variables using any names that you choose 6. Your updated CashRegister class will betested by data of our choos using the same method names mentioned in class and the new ones above, and therefore, it is important that you use the same method names and that they do the tasks described, above. est the abov e class by: • Creating one CashRegister object; add two days sales. • For First day add sales fortwo 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
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY