subject
Engineering, 25.04.2020 00:35 jbismyhusbandbae

Cashier Class SpecificationThe Cashier class represents a supermarket cashier. A cashier has a name (name instance variable), a total amount of money collected(total instance variable) after processing a number of items, a number of items processed (numberOfItems instance variable), and adescription of each item that was processed (allItemsScanned instance variable). The declaration of each variable follows. private String name;private int total, numberOfItems;private StringBuffer allItemsScanned;The class methods are:1. Constructor - Takes a string as parameter. The parameter represents the cashier’s name. It will initialize instance variablesaccordingly. The method assigns a StringBuffer object to the allItemsScanned instance variable. The method will throw (with any message) if the parameter is null or its length is less than 3.2. Copy Constructor - Creates a copy where changes to the copy will not affect the original.3. processItem - Takes as parameters a string representing an item, and an integer representing its price. It will append the string tothe allItemsScanned StringBuffer and will increase the number of items. No separator will be added (e. g., a comma). The totalinstance variable must be adjusted accordingly. The method will not modify the instance variables if the string parameter is null, if the string parameter is the empty string or if the price is negative. The method always returns a reference to the current object. No exception will be thrown by this method.4. getName - get method for name.5. getTotal - get method for total.6. getNumberOfItems - get method for numberOfItems.7. getAllItemsScanned - get method for allItemsScanned. You must avoid privacy leaks.8. compareTo - It has a Cashier as parameter and returns an integer. This method will return:a. A negative value if the total value of the current object is less than the parameter. b. A positive value if the total value of the current object is greater than the parameter. c. If the current object and the parameter have the same value for total, the method will return:i. A negative value if the number of items of the current object is greater than the parameter. ii. A positive value if the number of items of the current object is less than the parameter. iii. 0 otherwise.

ansver
Answers: 2

Another question on Engineering

question
Engineering, 04.07.2019 18:10
You are making beer. the first step is filling the glass carboy with the liquid wort. the internal diameter of the carboy is 15 in., and you wish to fill it up to a depth of 2 ft. if your wort is drawn from the kettle using a siphon process that flows at 3 gpm, how long will it take to fill?
Answers: 1
question
Engineering, 04.07.2019 18:10
Which of the following ziegler nichols tuning methods the response of the controller to a step input should exhibit an s-shaped curve? a)-open loop mode b)-closed loop mode c)-both modes (open & closed) d)-none of the modes (open & closed)
Answers: 3
question
Engineering, 04.07.2019 18:20
Steam enters a converging nozzle at 3.0 mpa and 500°c with a at 1.8 mpa. for a nozzle exit area of 32 cm2, determine the exit velocity, mass flow rate, and exit mach number if the nozzle: negligible velocity, and it exits (a) is isentropic (b) has an efficiency of 94 percent
Answers: 2
question
Engineering, 04.07.2019 18:20
Air flows over a heated plate àt a velocity of 50m/s. the local skin factor coefficient at a point on a plate is 0.004. estimate the local heat transfer coefficient at this point.the following property data for air are given: density = 0.88kg/m3 , viscosity 2.286 x 10 ^-5 kgm/s , k = 0.035w/mk ,cp = 1.001kj/kgk. use colburn reynolds analogy.
Answers: 1
You know the right answer?
Cashier Class SpecificationThe Cashier class represents a supermarket cashier. A cashier has a name...
Questions
question
Mathematics, 02.04.2021 22:30
question
Mathematics, 02.04.2021 22:30
question
Mathematics, 02.04.2021 22:30
Questions on the website: 13722362