I keep geting the following errors for my code while compilling can any one give me some dirrection on wha i have done wrong?
C:\Documents and Settings\Mark Standerfer.DESKTOP\My Documents\Inventory2.java:117: class, interface, or enum expected
System.out.printf("\n\nItem Name: %s\n",s.getItemName()); //display item name
^
C:\Documents and Settings\Mark Standerfer.DESKTOP\My Documents\Inventory2.java:118: class, interface, or enum expected
System.out.printf("Item Number: %s\n",s.getItemNumber()); //display item number
^
C:\Documents and Settings\Mark Standerfer.DESKTOP\My Documents\Inventory2.java:119: class, interface, or enum expected
System.out.printf("Quantity in Stock: %s\n",s.getStockQuantity()); //display quantity in stock
^
C:\Documents and Settings\Mark Standerfer.DESKTOP\My Documents\Inventory2.java:120: class, interface, or enum expected
System.out.printf("Item Price: $%.2f\n",s.getItemPrice()); //display item price
^
C:\Documents and Settings\Mark Standerfer.DESKTOP\My Documents\Inventory2.java:121: class, interface, or enum expected
System.out.printf("Value of Inventory: $%.2f\n",s.calculateInventoryValue()); //display total value of inventory for this item
^
C:\Documents and Settings\Mark Standerfer.DESKTOP\My Documents\Inventory2.java:122: class, interface, or enum expected
System.out.println("\n\nEnter item name or enter the word stop to quit: ");//prompt
^
C:\Documents and Settings\Mark Standerfer.DESKTOP\My Documents\Inventory2.java:123: class, interface, or enum expected
mySupplies.setItemName(input.next()); // read item name or stop
//Inventory2.java
//Program to display inventory information on multiple items
//Modified February 12, 2007
//Jeannie Pierce
import java.util.*;
class Product implements Comparable
{
private String name; // class variable that stores the item name
private double number; // class variable that stores the item number
private long stockQuantity; // class variable that stores the quantity in stock
private double price; // class variable that stores the item price
public Product() // Constructor for the Product class
{
name = "";
number = 0.0;
stockQuantity = 0L;
price = 0.0;
}
public Product(String name, int number, long stockQuantity, double price) // Constructor for the Supplies class
{
this.name = name;
this.number = number;
this.stockQuantity = stockQuantity;
this.price = price;
}
public void setItemName(String name) // Method to set the item name
{
this.name = name;
}
public String getItemName() // Method to get the item name
{
return name;
}
public void setItemNumber(double number) // Method to set the item number
{
this.number = number;
}
public double getItemNumber() // Method to get the item number
{
return number;
}
public void setStockQuantity(long quantity) // Method to set the quantity in stock
{
stockQuantity = quantity;
}
public long getStockQuantity() // Method to get the quantity in stock
{
return stockQuantity;
}
public void setItemPrice(double price) // Method to set the item price
{
this.price = price;
}
public double getItemPrice() // Method to get the item price
{
return price;
}
public double calculateInventoryValue() // Method to calculate the value of the inventory
{
return price * stockQuantity;
}
public int compareTo (Object o)
{
Product s = (Product)o;
return name.compareTo(s.getItemName());
}
public String toString()
{
return "Name: "+name + "\nNumber: "+number+"\nPrice: $"+price+"\nQuantity: "+stockQuantity + "\nValue: $"+calculateInventoryValue();
}
}//end class Product
public class Inventory2
{
// main methods begins execution of java application
public static void main( String args[])
{
Product[] supplies = new Product[3];
Product p1 = new Product("DVD", 02571, 167, 1500);
Product p2 = new Product("CDs", 02572, 10, 1200);
Product p3 = new Product("DVDRs", 02573, 17, 1600);
supplies[0] = p1;
supplies[1] = p2;
supplies[2] = p3;
double total = 0.0;
for(int i= 0; i < 3;i++)
{
total = total + supplies[i].calculateInventoryValue();
}
System.out.println("Total Value is: $"+total);
Arrays.sort(supplies);
for(Product s: supplies)
{
System.out.println(s);
System.out.println();
}
} // end main method
}//end class Inventory2
System.out.printf("\n\nItem Name: %s\n",s.getItemName()); //display item name
System.out.printf("Item Number: %s\n",s.getItemNumber()); //display item number
System.out.printf("Quantity in Stock: %s\n",s.getStockQuantity()); //display quantity in stock
System.out.printf("Item Price: $%.2f\n",s.getItemPrice()); //display item price
System.out.printf("Value of Inventory: $%.2f\n",s.calculateInventoryValue()); //display total value of inventory for this item
System.out.println("\n\nEnter item name or enter the word stop to quit: ");//prompt
mySupplies.setItemName(input.next()); // read item name or stop