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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 13:00, cookie1701
Why the bear has a slunky tail determine the meaning of the word slunk in the story
Answers: 1
image
Computers and Technology, 22.06.2019 17:30, uh8hardiek
Ou listened to a song on your computer. did you use hardware or software?
Answers: 2
image
Computers and Technology, 22.06.2019 19:40, rakanmadi87
Solve the following javafx application: write a javafx application that analyzes a word. the user would type the word in a text field, and the application provides three buttons for the following: - one button, when clicked, displays the length of the word.- another button, when clicked, displays the number of vowels in the word.- another button, when clicked, displays the number of uppercase letters in the word(use the gridpane or hbox and vbox to organize the gui controls).
Answers: 1
image
Computers and Technology, 23.06.2019 18:00, teamroper35
Which finger presses the h key on the keyboard? index finger on the left hand pinky finger on the right hand index finger on the right hand thumb on the left hand
Answers: 1
You know the right answer?
Online shopping cart (Java):
Create a program using classes that does the following in the zy...

Questions in other subjects:

Konu
Physics, 02.08.2021 14:00
Konu
Computers and Technology, 02.08.2021 14:00