I'm working on a program to keep track of a hardware store's inventory. For each item the item ID, item name, # of pieces ordered, # of pieces in stock, manufacturer's price and the selling price. The program must also print out a report. The program is menu driven and uses seven parallel vectors to store the information. The program must have a method to input the data into the vectors, a method to display the menu, a method to sell an item, and a method to print the report.
And I keep getting the following error messages "Illegal start of expression." Below is my code that I have so far
import java.io.*;
import java.util.*;
public class Ch10
{
public static void main(String[] args) throws FileNotFoundException
{
int[]ItemIdList = new int[10];
String[]ItmNmeList = new String[10];
int[]PordrList = new int[10];
int[]InStreList = new int[10];
int[]PSldList = new int[10];
Double[]ManuPrceList = new Double[10];
Double[]SelPrceList = new Double[10];
Scanner inFile = new Scanner(new FileReader("e:\\Ch10_Ex2Data.txt"));
inputData(inFile, ItmIdList, ItmNmeList, PordrList, InStreList, PSldList, ManuPrceList, SelPrceList);
sortData(ItmIdList, ItmNmeList, PordrList, InStreList, PSldList, ManuPrceList, SelPrceList);
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 the Friendly Hardware Store");
System.out.println("To view our available items and their quantity, press 1");
number = console.nextint();
if (number = 2)
for (index=0; index<inpName.length;index++)
System.out.print(" here is a current lisiting of items :" +inpName[index]);
else
System.out.println();
System.out.println("To sell an item, press 3");
System.out.println("To print a report, press 4");
}
//method to sell an item
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)
}
//method to print out the report
public static void printRpt()
{
int[]ItemID;
String[] ItemName;
int[]pOrdered;
int[]pinStore;
int[] pSold;
int i,j;
double manufPrice, sellingPrice;
double totInventory;
int totitems = 0;
int totinstore = 0;
system.out.println("--------------------Friendly Hardware Store"+ "--------------------\n");
system.out.println ("ItemID " + " ItemName " + "pOrdered "+ " pinStore " + " pSold " + " manufPrice " + " sellingPrice ");
System.out.printf(itemID[], ItemName[], pOrdered[], pinStore[], pSold[], manufPrice[], sellingPrice[]);
for (i=0; i < pSold.length; i++)
totitems = totitems + pSold[i];
System.out.println ("Total inventory: " + totitems);
for (j=0; j < pinStore.length; j++)
totinstore = totinstore + pinStore[j];
System.out.println ("Total number of items in the store: " + totinstore);
}
}
}