[SOLVED] SOLVED:Java Class product which has attributes: String name, type integer number_on_hand,

19.99 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

docx file icon PerishableProduct_Answers.docx (16.8 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
🔒 Securely Powered by:
Secure Checkout
5/5 - (1 vote)

Define a Java Class product which has attributes: String name, type integer number_on_hand, and double price Write all the getters and setters for each of these values. Write a default constructor which has no values and a constructor which takes all values as parameters and initialized the attribute to the values passed

Define a class PerishableProduct which extends product and has additional attributes integer day month and year, which represent a use by date. Write the necessary getters and setters and write a pair of constructors like in 1.

Write a piece of java code that prompts the user the name, type, price, quantity and use by date of a perishable product and creates an object with those values.

Write a piece of java code that prompts the users for a text file name creates a scanner for the file and then reads Perishable product from the file into an array called inventory.

Write a piece of java code that prompts the user for the name of a perishable product and searches the array inventory to find the product and prints out the price.

Write a piece of java code that prompts the user for a file name and opens a text file for output and writes the array inventory to the file and closes the file.

  • PerishableProduct_Answers.docx