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:40
Respecting individual differencespre-test active2time remaining48: 47nina is exploring her gender identity and sexual orientationwhich best describes how the role of the media might influence nina during this time in her life? the media would her decide because television shows are always unbiased about gender issues and do notstereotypethe media could make things difficult for her because television sometimes portrays rigid ideas about gender roles.all forms of media will her decide because the media always portrays rigid ideas about gender roles.all forms of media will make things easy for her because the media always portrays open and fair ideas about gender roles.
Answers: 1
question
Computers and Technology, 22.06.2019 15:10
Which activity should be part of a long-term plan to positively affect yourhealth? oa. wearing regular clothing when handling toxinsob. not worrying about secondhand smokeoc. avoiding excessive exposure to sunlightod. drinking only well water
Answers: 1
question
Computers and Technology, 22.06.2019 18:00
Budgets you to do all of the following expect a) send frivolously b) avoid over spending c) gain financial independence d) examine your priorities and goals
Answers: 2
question
Computers and Technology, 23.06.2019 02:30
How to launch an app: steps to be successful? launching an app is a great idea, but it’s not that easy as we supposed to think. the majority of mobile applications don’t generate revenue because companies aren’t ready to be competitive. referring to our experience in successfully building and launching apps we hope to you omit these difficulties. we are going to talk about ideas, marketing, testing your product, its development, distribution and support. you will learn 8 product launch stages to succeed.
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, 08.12.2020 01:40
question
Mathematics, 08.12.2020 01:40
question
Computers and Technology, 08.12.2020 01:40
question
Mathematics, 08.12.2020 01:40
question
Mathematics, 08.12.2020 01:40
question
English, 08.12.2020 01:40
Questions on the website: 13722367