Create a class Ledger that will record the sales for a store. It will have the attributes
• sale—an array of double values that are the amounts of all sales
• salesMade—the number of sales so far
• maxSales—the maximum number of sales that can be recorded
and the following methods:
• Ledger(max)—a constructor that sets the maximum number of sales to max
• addSale(d)—adds a sale whose value is d
• getNumberOfSales—returns the number of sales made
• getTotalSales—returns the total value of the sales
See the code in Ledger.java.
You might also like to view...
Which of the following statements is true about this line?
Consider the following line of code. ``` Comparable s = new String(); ``` a) It will result in a compile-time error. b) It will result in a run-time error. c) It will create a String object pointed to by a Comparable reference. d) Although it is perfectly valid Java, it should be avoided due to confusion. e) none of the above are true
A web browser's ________ feature makes it easy to return to a specific web page.
Fill in the blank(s) with the appropriate word(s).
You can add a shortcut to a menu by preceding one of the characters in the menu name with a(n) ____. This places an underline under the next character typed.
A. underscore (_ ) B. hyphen (-) C. ampersand (&) D. asterisk (*)
A(n) ____ comment hides multiple lines of code.?
A. ?variable B. ?element C. ?line D. ?block