

ItemToPurchase item1 = new ItemToPurchase() (2 pts)Įx: TOTAL COST Chocolate Chips 1 $3 = $3 Bottled Water 10 $1 = $10 Total: $13 (3) Add the costs of the two items together and output the total cost. (2 pts)Įx: 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 Before prompting for the second item, call scnr.nextLine() to allow the user to input a new string. (2) In main(), prompt the user for two items and create two objects of the ItemToPurchase class. Public member methods (mutators & accessors) Int itemQuantity - Initialized in default constructor to 0 Int itemPrice - Initialized in default constructor to 0 String itemName - Initialized in default constructor to "none" ShoppingCartPrinter.java - Contains main() methodīuild the ItemToPurchase class with the following specifications: Click the current file name, then select the file you need.


To switch files, look for where it says "Current File" at the top of the developer window.

For this lab, you will be working with two different class files. Create a program using classes that does the following in the zyLabs developer below.
