I am a student working on an inventory app. Until this current assignment I felt I half way knew what I was doing. What is required is the following:
~Modify the program to handle multiple items: should work with this code added - it worked on another program
//Prompt user for number of employees
System.out.print("Number of employees: ");
int numEmployees = stdIn.nextInt();
//Create employee array to store data
Employee[] emp = new Employee[numEmployees];
~ Use an array to store the data - again should work with the addition of preceding code
~ Store and print out the input data for each item (name, product number, on-hand quantity, price, total price of that item type)one item at a time need help here
~Calculate the total vale of items on hand - (general concept is total values * numProducts) how to accomplish this I need help
~Sort the array by title - again big help needed
Here is the code I have to this point
// inventory app program
import java.util.Scanner;
public class InventoryApp {
// main begin Java application
public static void main (String[] args)
{
//initialize keyboard
Scanner input = new Scanner(System.in);
String name;
String item;
int number;
double price;
System.out.println("Please enter the DVD Title:");
dvd.setName(input.nextLine());
System.out.print ("Enter DVD iten number"); //prompt
dvd.setItem(input.next());
System.out.println();
System.out.print ("Enter number of DVD's on hand: ");
dvd.setNumber(input.nextInt());
System.out.println();
System.out.print ("Enter the Retail Price for the DVD: ");
dvd.setPrice(input.nextDouble());
System.out.println();
System.out.printf("%s's Total Retail Value is: $%.2f\n",
dvd.getName(), dvd.getTotal ());
System.out.println();
System.out.println();
} // end main
}//end class InventoryApp
// DvdCollection class
/* • Create a product class that holds the item number,
the name of the product, the number
of units in stock, and the price of each unit.*/
// Class DvdCollection
public abstract class DvdCollection
{
private String name;
private String item;
private int number;
private double price;
public double total;
public double grandtotal;
public DvdCollection ()
{
//implicit call to object constructor occurs here
name = "Title";
item = "123456";
number = 0;
price = 2.99;
}
// Four argument initialization constructor
public DvdCollection(String dvdnameIn, String itemnumberIn, int numberonhandIn,
double retailpriceIn)
{
//implicit call to object constructor occurs here
name = dvdnameIn;
item = itemnumberIn;
number = numberonhandIn;
price = retailpriceIn;
} // end four argument intialization constructor
public void setName (String name)
{
this.name = name;
}
public String getName ()
{
return name;
}
public void setItem (String item)
{
this.item = item;
}
public double getItem ()
{
return item;
}
public void setNumber (int number)
{
this.number = number;
}
public int getnumber ()
{
return number;
}
public void setPrice(double price)
{
this.price = price;
}
public double getPrice()
{
return price;
}
public double getTotal ()
{
return price * number;
}
} // end class DvdCollection
Thanks