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, 23.06.2019 18:40
How does is make you feel when you're kind to others? what are some opportunities in your life to be more kind to your friends and loved ones? imagine a world where kindness has be outlawed. how would people act differently? would your day-to-day life change significantly? why or why not?
Answers: 2
question
Computers and Technology, 24.06.2019 07:00
Into what form does the barcode reader convert individual bar patterns?
Answers: 1
question
Computers and Technology, 24.06.2019 23:40
Which slide should you change so it reflects om all sides of your presentation
Answers: 1
question
Computers and Technology, 25.06.2019 06:30
How can u permanently delete a picture from your camera ?
Answers: 1
You know the right answer?
Online shopping cart (Java):
Create a program using classes that does the following in the zy...
Questions
Questions on the website: 13722367