(1) Create two files to submit: ItemToPurchase.java - Class definition 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() & getName() \ setPrice() & getPrice()  setQuantity() & getQuantity()

EBK JAVA PROGRAMMING
8th Edition
ISBN:9781305480537
Author:FARRELL
Publisher:FARRELL
Chapter16: Graphics
Section: Chapter Questions
Problem 10PE
icon
Related questions
Question

(1) Create two files to submit:

  • ItemToPurchase.java - Class definition

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() & getName() \
    • setPrice() & getPrice() 
    • setQuantity() & getQuantity() 
LAB
ACTIVITY
30.13.1: LAB*: Program: Online shopping cart (Part 1)
1/* Type code here. */
Current file: Item ToPurchase.java
Transcribed Image Text:LAB ACTIVITY 30.13.1: LAB*: Program: Online shopping cart (Part 1) 1/* Type code here. */ Current file: Item ToPurchase.java
Expert Solution
steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Knowledge Booster
Properties of CSS
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT