Question: LANGUGE IS JAVA, i have most of the code right but for the last input i dont know why i get that error. the instructor

 LANGUGE IS JAVA, i have most of the code right butfor the last input i dont know why i get that error.the instructor gave me the soltuion but i dont know how toimplement it. need output to be exactly as expected output. (1) Createtwo files to submit: Item ToPurchase.java - Class definition ShoppingCartPrinter.java - Contains

LANGUGE IS JAVA, i have most of the code right but for the last input i dont know why i get that error. the instructor gave me the soltuion but i dont know how to implement it. need output to be exactly as expected output.

(1) Create two files to submit: Item ToPurchase.java - Class definition ShoppingCartPrinter.java - Contains main0 methood Build the ItemToPurchase class with the following specifications: Private fields String itemName- Initialized in default constructor to "none" int itemPrice - Initialized in default constructor to 0 int itemQuantity-initialized in default constructor to 0 Default constructor Public member methods (mutators & accessors) setName & getName0 (2 pts) setPrice0 & getPrice0 (2 pts) setQuantity0 & getQuantity0 (2 pts) . (2) In main0, prompt the user for two items and create two objects of the ItemToPurchase class. Before prompting for the second item, call scnr.nextLine0; to allow the user to input a new string. (2 pts) Ex: Item 1 Enter the item name: Chocolate Chips Enter the item price: 3 Enter the item quantity: Item 2 Enter the item name: Bottled Water Enter the item price

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!