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
Abrake has a normal braking torque of 2.8 kip in and heat-dissipating cast-iron surfaces whose mass is 40 lbm. suppose a load is brought to rest in 8.0 s from an initial angular speed of 1600 rev/min using the normal braking torque; estimate the temperature rise of the heat dissipating surfaces.
Answers: 3
question
Engineering, 04.07.2019 18:10
For the closed feedwater heater below, feedwater enters state 3 at a pressure of 2000 psia and temperature of 420 °f at a rate of ix10 ibhr. the feedwat extracted steam enters state 1 at a pressure of 1000 psia and enthalpy of 1500 btu/lbm. the extracted er leaves at an enthalpy of 528.7 btu/lbm steam leaves as a saturated liquid. (16) a) determine the mass flow rate of the extraction steam used to heat the feedwater (10) b) determine the terminal temperature difference of the closed feedwater heater
Answers: 3
question
Engineering, 04.07.2019 19:10
Air inially occupying a volume of 1 m2 at 100 kpa, 27 c undergoes three internally reversible processes in series. process 1-2 compression to 500 kpa during which pv constant process 2-3 adiabatic expanslon to 100 kpa process 3-1: constant-pressure expansion to 100 kpa (a) calculate the change of entropy for each of the three processes. (b) calculate the heat and work involved in each process. (c) is this cycle a power cycle or refrigeration cycle?
Answers: 3
question
Engineering, 04.07.2019 19:10
The maximum shear stress and maximum flexural stress occur at the same location along a beam subjected to a non-uniform bending load. a)-trune b)- false
Answers: 2
You know the right answer?
Cashier Class SpecificationThe Cashier class represents a supermarket cashier. A cashier has a name...
Questions
Questions on the website: 13722362