subject

Consider a class that keeps track of sales of an item. An object of this class will have the following attribute. Number sold Total sales Total discounts Cost per item Bulk quantity Bulk discount percentage/amount and the following methods registerSale(n) records the sale of n items. If n is larger than the bulk quantity, the cost per item will be reduced by the bulk discount. displaySales displays the number sold, total sales and total discount. a. Implement the class in Java
b. Write some java statements that test the class.

Define a method initialize inside the class to initialize the item cost, bulk quantity and bulk discount(if items are ordered in bulk). For example, Let us say customer is purchasing laptops.

1. You initialize the cost of each item with $500 and a discount of $100 is applied for every 10 laptops ordered.
2. Register the sale of 20 items and check for bulk discount
3. Your total order will be $8000 with a discount of $2000

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 02:30
Which component acts as a platform on which application software runs
Answers: 2
question
Computers and Technology, 23.06.2019 21:50
Description: write function lastfirst() that takes one argument—a list of strings of the format "lastname, firstname" —and returns a list consisting of two lists: (a) a list of all the last names (b) a list of all the first names
Answers: 2
question
Computers and Technology, 24.06.2019 08:00
Arah has entered data about football players from team a and team b in a worksheet. she enters names of players from team a with details about each player in different columns of the worksheet. similarly, she enters details of all the players from team b. which option will her view the data for team a and team b in two separate sections after printing? a. page break view b. freeze pane view c. split screen view d. full screen view e. zoom out view
Answers: 1
question
Computers and Technology, 25.06.2019 09:20
Problem 3: (hand) write the member function implementations for the class hand, which simulates a hand of 2 cards, into the file hand.cpp. the relative strength of 2 hands are determined by the following rules: • a pair (two cards of the same number) is the strongest hand. • two cards of the same suit is the next strongest hand. • two cards of different numbers and suits is the weakest hand. • within the same kind of hands, the stronger hand is determined by the larger number. • if two hands are of the same kind and the larger numbers are the same, the stronger hand is given by the hand whose smaller number is larger. • if all above fails, the two hands are of equal strength. i.e., all suits are of equal strength. • 2 is the weakest number. an ace is stronger than a king. you are using a single deck of cards. so a hand of a♥a♥ is impossible. here are some examples:
Answers: 3
You know the right answer?
Consider a class that keeps track of sales of an item. An object of this class will have the followi...
Questions
question
History, 24.09.2019 15:30
Questions on the website: 13722363