Java Programming Worksheet Essay Paper

1) Book Class
Write a class named Book that has fields to hold the following data:
Title
Author
Year published
ISBN number
In the Book class, also include
A mutator method for each field to set the value for the field
An accessor method for each field to get the value for the field
Write a separate demo program that Utilizies the class by creating three instances of the class.
 
2) ShoppingCartItem class
Write a class named ShoppingCartItem that has fields to hold the following data:
Name

Quantity
Price
In the ShoppingCartItem class, also include
A constructor that accepts arguments for the name and ID number and assigns them to their respective fields. Initialize the quantity and price fields as well.
A mutator method for each field to set the value for the field
An accessor method for each field to get the value for the field
A method that returns the total price of the item calculated as quantity times price
Write a separate demo program that Utilizies the class bycreating a ShoppingCartItem object and asking the user to enter the data for each of the objects fields.
The program should display the total price at the end with a label.
 
3) GroceryItem Class
Write a class named GroceryItem that holds data on an item in a grocery store. Include the following fields:
description – a String that holds the description of the item
brand – a String that holds the brand of the item
inventory – an int that holds the number of units in the inventory
price – a double that holds the items price
Also implement:
A constructor that accepts an argument for each field and assigns them to their respective fields
A default constructor that set the description to an empty string ( ), inventory to 0, and price to 0.0
A mutator method for each field to set the value for the field
An accessor method for each field to get the value for the field
Once the class is complete, Write a separate demo program that utilizes the GroceryItem class.
The program should create two GroceryItem objects with the following data:
Description
Inventory
Price
Item

Calculate your order
Pages (275 words)
Standard price: $0.00
Client Reviews
4.9
Sitejabber
4.6
Trustpilot
4.8
Our Guarantees
100% Confidentiality
Information about customers is confidential and never disclosed to third parties.
Original Writing
We complete all papers from scratch. You can get a plagiarism report.
Timely Delivery
No missed deadlines – 97% of assignments are completed in time.
Money Back
If you're confident that a writer didn't follow your order details, ask for a refund.

Calculate the price of your order

You will get a personal manager and a discount.
We'll send you the first draft for approval by at
Total price:
$0.00
Power up Your Academic Success with the
Team of Professionals. We’ve Got Your Back.
Power up Your Study Success with Experts We’ve Got Your Back.
error: Content is protected !!
Open chat
1
You can contact our live agent via WhatsApp! Via + 1 3234125597

Feel free to ask questions, clarifications, or discounts available when placing an order.

Order your essay today and save 5% with the discount code HAPPY