subject

Online shopping cart (Java):
Create a program using classes that does the following in the zyLabs developer below. For this, you will be working with two different class files.
(1) Create two files to submit:
O ItemToPurchase. java - Class definition
O ShoppingCartPrinter. java - Contains main() method
Build the ItemToPurchase class with the following specifications:
O Private fields
O String itemName - Initialized in default constructor to "none"
O int itemPrice - Initialized in default constructor to 0
O int itemQuantity - Initialized in default constructor to 0
O Default constructor
O Public member methods (mutators & accessors)
O setName() & getName()
O setPrice() & getPrice()
O setQuantity() & getQuantity()
(2) In main(), prompt the user for two items and create two objects of the ItemToPurchase class. Before prompting for the second item, call scnr. nextLine(); to allow the user to input a new string.
Ex:
Item 1
Enter the item name: Chocolate Chips
Enter the item price: 3
Enter the item quantity: 1
Item 2 Enter the item name:
Bottled Water
Enter the item price: 1
Enter the item quantity: 10
(3) Add the costs of the two items together and output the total cost.
Ex:
TOTAL COST
Chocolate Chips 1 @ $3 = $3
Bottled Water 10 @ $1 = $10
Total: $13

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 02:10
3. (5 points) describe what would be printed by the code below or what error would occur. const char* cstr = "0123456"; const char* ptr = & cstr[4]; cout < < ptr[-1] < < ptr < < endl; 1 4. (5 points) theseus has been trapped in a maze with a minotaur, which is trying to capture him. each round, theseus and the minotaur move through the maze; theseus towards the exit, and the minotaur towards theseus. theseus can move in any of the four cardinal directions, or he can wait for a round to see how the minotaur moves. write code that creates a data type to represent the possible moves that theseus could make.
Answers: 3
question
Computers and Technology, 23.06.2019 09:30
Name the range function that would generate the following list of integers values: 0,1,2,3,4,5.
Answers: 1
question
Computers and Technology, 23.06.2019 17:30
Scientists have changed the model of the atom as they have gathered new evidence. one of the atomic models is shown below. what experimental evidence led to the development of this atomic model from the one before it? a few of the positive particles aimed at a gold foil seemed to bounce back. the colors of light emitted from heated atoms had very specific energies. experiments with water vapor showed that elements combine in specific proportions. cathode rays were bent in the same way whenever a magnet was brought near them.
Answers: 2
question
Computers and Technology, 24.06.2019 01:10
Create a program that will take in a single x and y coordinate as the origin. after the input is provided, the output should be all of the coordinates (all 26 coordinates read from the “coordinates.json” file), in order of closest-to-farthest from the origin.
Answers: 1
You know the right answer?
Online shopping cart (Java):
Create a program using classes that does the following in the zy...
Questions
question
Mathematics, 25.06.2019 22:30
Questions on the website: 13722361