subject

Note: creating multiple scanner objects for the same input stream yields unexpected behavior. thus, good practice is to use a single scanner object for reading input from system. in. that scanner object can be passed as an argument to any methods that read input.

this program extends the earlier "online shopping cart" program. (consider first saving your earlier program).

(1) extend the itemtopurchase class per the following specifications:

private fields

string itemdescription - initialized in default constructor to "none"

parameterized constructor to assign item name, item description, item price, and item quantity (default values of 0). (1 pt)

public member methods

setdescription() mutator & getdescription() accessor (2 pts)

printitemcost() - outputs the item name followed by the quantity, price, and subtotal

printitemdescription() - outputs the item name and description

ex. of printitemcost() output:

bottled water 10 @ $1 = $10

ex. of printitemdescription() output:

bottled water: deer park, 12 oz.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 09:00
Designing a mobile web page is a little different from designing a regular web page. name at least three features that should be considered when designing a website that is mobile phone-friendly, and briefly explain why they are important.
Answers: 1
question
Computers and Technology, 23.06.2019 10:20
Suppose there is a relation r(a, b, c) with a b+-tree index with search keys (a, b).1. what is the worst-case cost of finding records satisfying 10 < a < 50 using this index, in terms of the number of records n1, retrieved and the height h of the tree? 2. what is the worst-case cost of finding records satisfying 10 < a < 50 and 5 < b < 10 using this index, in terms of the number of records n2 that satisfy this selection, as well as n1 and h defined above? 3. under what conditions on n1 and n2, would the index be an efficient way of finding records satisfying the condition from part (2)?
Answers: 1
question
Computers and Technology, 24.06.2019 09:30
Retype the statements, correcting the syntax errors. system.out.println("num: " + songnum); system.out.println(int songnum); system.out.println(songnum " songs"); note: these activities may test code with different test values. this activity will perform two tests: the first with songnum = 5, the second with songnum = 9. see how to use zybooks.
Answers: 1
question
Computers and Technology, 24.06.2019 20:20
3. write assignment statements that perform the following operations with the variables a, b, and c: a. adds 2 to a and assigns the result to b b. multiplies b times 4 and assigns the result to a c. divides a by 3.14 and assigns the result to b
Answers: 2
You know the right answer?
Note: creating multiple scanner objects for the same input stream yields unexpected behavior. thus,...
Questions
question
Mathematics, 20.03.2021 01:00
question
History, 20.03.2021 01:00
Questions on the website: 13722361