Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Your friend who works at the superstore is urgently in need of your help with some basic sales records Consider a class Sales that keeps

image text in transcribed

Your friend who works at the superstore is urgently in need of your help with some basic sales records Consider a class Sales that keeps track of the sales of one item in the store. An object of this class will have the attributes -Name of the item Cost of the item Bulk quantity (to qualify for discount) -Discount (percentage) -Number sold Total amount Total discount and the following methods Constructor that sets the cost, bulk quantity and the discount Get and set methods for cost, bulk quantity and discount registerSale(int n) records the sale of n items. If n is larger than the bulk quantity, the cost will be reduced by the discount. displaySales displays the name of the item, number sold, the total amount, and total discount. Ignore sales tax Implement the class and test it. For example, for Item: Shampoo Cost: 2.500 Bulk quantity (to qualify for discount): 4 Discount: 10 percent Number sold: 10 The output would be: Shampoo Number sold: 10 Total amount: $ 22.50 Total discount: $ 2.50 Other Example Item: Toothpaste Cost: 1.9.9 Bulk quantity: 20 Discount: 15 Number sold: 10 The output would be Toothpaste Number sold: 10 Total amount: 19.90 Total discount: 0

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions