Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

java eclipse To do: You work at a nursery and keep track of the inventory of plants available. Create a class named Supplier that has

java eclipse

To do: You work at a nursery and keep track of the inventory of plants available. Create a class named Supplier that has instance variables of supplierId, companyName and phone. Include your two constructors, toString() method and getters and setters.

Create a class named Inventory that has instance variables of inventoryId, itemName, numInStock, priceEach, and Supplier. Include your two constructors, toString() method and getters and setters. Write a method named totalValue() that returns the number in stock times the price each.

Write a driver program named NurseryDriver that asks the user for the supplier id, the company name and the phone number. Create an instance of the Supplier class. Then ask the user for the number of items and loop to get the details for each (see sample output below). Create an instance of the Inventory class (let Java generate the inventory id starting at 1000). Call the toString() method of the Inventory class to print out the item. Repeat the loop.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

1. Explain how business strategy affects HR strategy.

Answered: 1 week ago