Write a program to keep track of a hardware store\'s inventory. The store sell v
ID: 3640593 • Letter: W
Question
Write a program to keep track of a hardware store's inventory. The store sell various items. For each item in the store the following information is kept: item ID, item name, number of pieces ordered, number of pieces currently in the store, number of pieces sold, manufacturer's price for the item, and the stores selling price. At the end of each week the store manager wants to see a report in the following form:Friendly Hardware Store
itemID itemName pOrdered pInStore pSold manufPrice sellingPrice
1111 Circular Saw 150 110 40 45.00 125.00
2222 Cooking Range 50 30 20 450.00 850.00
.
.
.
Total Inventory: $#########.##
Total number of items in the store:_________
The total inventory is the total selling value of all the tiems currently in the store. The total number of items is the sum of the number of pieces of all the items in the store.
Your program must be menu driven, giving the user various choices such as: Check whether an item is in the store, sell an item, and print the report. After inputting the data, sort it according to the items; names. also, after an item is sold, update the appropriate counts.
Initially, the number of pieces (of an item) in the store is the same as the number of pieces ordered, and the number of pieces of an item sold is zero. Input to the program is a file consisting of data in the following form:
itemID
itemName
pOrdered manufPrice sellingPrice
after inputting data, sort it according to the items names.
the program should read from file.
i did some work but throwing many errors
import java.io.*;
import java.util.Scanner;
import java.util.Vector;
public class trial {
/**
* @param args
*/
public static void main(String[] args) throws FileNotFoundException {
int[]ItemIdList = new int[10];
String[]ItemNameList = new String[10];
int[]POrderList = new int[10];
int[]InStoreList = new int[10];
int[]PSldList = new int[10];
Double[]ManufacturePrice = new Double[10];
Double[]RetailPrice = new Double[10];
Scanner inFile = new Scanner(new FileReader("Inventory.txt"));
inputData(inFile, ItemIdList, ItemNameList,POrderList, InStoreList, PSldList, ManufacturePrice, RetailPrice);
sortData(ItemIdList, ItemNameList, POrderList, InStoreList, PSldList, ManufacturePrice, RetailPrice);
printMenu();
printRpt();
public static inputData(Scanner input, Vector<Integer> inpID, Vector<String> inpName, Vector<Integer> inpOrdered, Vector<Integer> inpInStore,Vector<Integer> inpSold, Vector<Double> inpManPrice, Vector<Double> inpSellPrice);
{
int id;
String name;
int order;
double price, sellPrice;
while (input.hasNext());
{
id = input.nextInt();
name = input.nextLine();
order = input.nextInt();
price = input.nextDouble();
sellPrice = input.nextDouble();
inpID.addElement(new Integer(id));
inpName.addElement(name);
inpOrdered.addElement(new Integer(order));
inpInStore.addElement(new Integer(order));
inpSold.addElement(new Integer(0));
inpManPrice.addElement(new Double(price));
inpSellPrice.addElement(new Double(sellPrice));
}
}
public static void printMenu();
{
int number;
int index;
System.out.println("Welcome to Friendly's Hardware Store");
System.out.println("To Check Avaliable items and quantity, Press 1");
number = console.nextint();
if (number = 2);
for (index = 0; index<inpName.length;index++);
System.out.print(" Here is Current Listing of Items :" +inpName[index]);
else
System.out.println();
System.out.println("To Sell an Item, Press 3");
System.out.println("To Print Report, Press 4");
}
public static void sellItem()
{
int item;
string name;
int sold;
int store;
System.out.println("Enter item Number: ");
int item= console.nextInt();
System.out.println("Enter the Item Name: ");
String name = console.next();
System.out.println("Enter Quantity sold: ");
int sold = console.nextint();
public int indexOf(Object item)
}
public static void printRpt()
{
int[]itemID;
String[]itemName;
int[]POrdered;
int[]pinStore;
int[]pSold;
int i,j;
double ManufacturePrice, sellingPrice;
int totalitems = 0;
int totinstore = 0;
system.out.println("..................Friendly Hardware Store"+ ".................../n");
System.out.println("ItemID" + "ItemName " + "pOrdered" + " pinStore" + "pSold" + "ManufacturePrice" + "SellingPrice");" +
system.out.printf(itemID[], ItemName[], pOrdered[], pinStore[], pSold[], ManufacturePrice[], sellingPrice[]);
for (i=O; i<pSold.length; i++);
totitems = totitems + pSold[i];
System.out.println("Total Number of Items in the Store " + totinstoe);
}
}
private static void printRpt() {
// TODO Auto-generated method stub
}
private static void printMenu() {
// TODO Auto-generated method stub
}
private static void sortData(int[] itemIdList, String[] itemNameList,
int[] pOrderList, int[] inStoreList, int[] pSldList,
Double[] manufacturePrice, Double[] retailPrice) {
// TODO Auto-generated method stub
}
private static void inputData(Scanner inFile, int[] itemIdList,
String[] itemNameList, int[] pOrderList, int[] inStoreList,
int[] pSldList, Double[] manufacturePrice, Double[] retailPrice) {
// TODO Auto-generated method stub
}
}