Part I - Retailltem Class Write a Java class named Retailltem that holds data about an item in a retail store. The class should have the following fields: description. The description field references a String object that holds a brief description of the item. unitsOnHand. The unitsOnHand field is an int variable that holds the number of units currently in inventory. price. The price field is a double that holds the item's retail price. Write a constructor that accepts arguments for each field, appropriate mutator methods that store values objects and stores the following data in them: Description Units on Hand Price 12 59.95 Item #1 Jacket Item #2 Designer Jeans 40 Item #3 Shirt 20 34.95 24.95 Create an array in which you save the items described above. these fields, and accessor methods that return the values in these fields. Once you have written the class, write a separate program that creates three Retailltem

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter10: Introduction To Inheritance
Section: Chapter Questions
Problem 1GZ
icon
Related questions
Question

I need this assignment done in java with screenshots of it running.

Part I - Retailltem Class
Write a Java class named Retailltem that holds data about an item in a retail store. The class should have the following fields:
description. The description field references a String object that holds a brief description of the item.
unitsOnHand. The unitsOnHand field is an int variable that holds the number of units currently in inventory.
price. The price field is a double that holds the item's retail price.
Write a constructor that accepts arguments for each field, appropriate mutator methods that store values in these fields, and accessor methods that return the values in these fields. Once you have written the class, write a separate program that creates three Retailltem
objects and stores the following data in them:
Description
Item #1 Jacket
Units on Hand Price
12
59.95
Item #2 Designer Jeans |40
Item #3 Shirt
20
34.95
24.95
Create an array in which you save the items described above.
Part II CashRegister Class
Write a Cash Register class that can be used with the Retailltem class that you wrote. The Cash Register class should simulate the sale of a retail item. It should have a constructor that accepts a Retailltem object as an argument. The constructor should also accept an
integer that represents the quantity of items being purchased. In addition, the class should have the following methods:
The getSubtotal method should return the subtotal of the sale, which is the quantity multiplied by the price. This method must get the price from the Retailltem object that was passed as an argument to the constructor.
The getTax method should return the amount of sales tax on the purchase. The sales tax rate is 6 percent of a retail sale.
The getTotal method should return the total of the sale, which is the subtotal plus the sales tax.
Demonstrate the class in a program that performs the following tasks:
• displays the list of items available in the store
• prompts the user to enter an item number and reads the value
• asks the user for the quantity of items being purchased
• displays the sale's subtotal, amount of sales tax, and total.
Save the purchases in an array of type CashRegister.
Simulate at least 3 purchases for a day, and save all values in the array defined earlier. Calculate the total number of items purchased for the day, and the total price paid for them.
Upload all the JAVA files in a zip file and create a word document with all the screenshots of your running program and upload all these files.
Transcribed Image Text:Part I - Retailltem Class Write a Java class named Retailltem that holds data about an item in a retail store. The class should have the following fields: description. The description field references a String object that holds a brief description of the item. unitsOnHand. The unitsOnHand field is an int variable that holds the number of units currently in inventory. price. The price field is a double that holds the item's retail price. Write a constructor that accepts arguments for each field, appropriate mutator methods that store values in these fields, and accessor methods that return the values in these fields. Once you have written the class, write a separate program that creates three Retailltem objects and stores the following data in them: Description Item #1 Jacket Units on Hand Price 12 59.95 Item #2 Designer Jeans |40 Item #3 Shirt 20 34.95 24.95 Create an array in which you save the items described above. Part II CashRegister Class Write a Cash Register class that can be used with the Retailltem class that you wrote. The Cash Register class should simulate the sale of a retail item. It should have a constructor that accepts a Retailltem object as an argument. The constructor should also accept an integer that represents the quantity of items being purchased. In addition, the class should have the following methods: The getSubtotal method should return the subtotal of the sale, which is the quantity multiplied by the price. This method must get the price from the Retailltem object that was passed as an argument to the constructor. The getTax method should return the amount of sales tax on the purchase. The sales tax rate is 6 percent of a retail sale. The getTotal method should return the total of the sale, which is the subtotal plus the sales tax. Demonstrate the class in a program that performs the following tasks: • displays the list of items available in the store • prompts the user to enter an item number and reads the value • asks the user for the quantity of items being purchased • displays the sale's subtotal, amount of sales tax, and total. Save the purchases in an array of type CashRegister. Simulate at least 3 purchases for a day, and save all values in the array defined earlier. Calculate the total number of items purchased for the day, and the total price paid for them. Upload all the JAVA files in a zip file and create a word document with all the screenshots of your running program and upload all these files.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Knowledge Booster
Unreferenced Objects
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:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,