ben29palms
2008-12-05 22:49:29 UTC
ERROR
Compiling 2 source files to C:\Documents and Settings\\My Documents\NetBeansProjects\inventory\build\classes
C:\Documents and Settings\\My Documents\NetBeansProjects\inventory\src\inventory\Main.java:37: cannot find symbol
symbol : constructor Merchandise(double,double,double,java.lang.String)
location: class inventory.Merchandise
Merchandise merch = new Merchandise (Amount, Cost, Number, Name);
CODE
public class Merchandise
{//Begining of Class
String Name;
String name;
double Number;
double Amount;
double Cost;
double MCost;
double MAmount;
double MNumber;
double TCost;
Merchandise(String name, double MNumber, double MAmount, double MCost)
{
Name = name;
Number = MNumber;
Amount = MAmount;
Cost = MCost;
}
public String getName()
{
return name;
}
public double getCost()
{
return MCost;
}
public double getAmount()
{
return MAmount;
}
public double getNumber()
{
return MNumber;
}
public double getTCost()
{
TCost = Cost * Amount;
return TCost;
}
} //End of Class
///////////////////////////////////////////////////////////////////////////////////////////
import java.util.Scanner;
public class Main
{
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
String Name;
double Amount;
double Cost;
double Number;
double TCost;
double MAmount;
double MCost;
double MNumber;
String name;
{
do
{
System.out.print("Please Enter the merchandise name or enter stop to termanate Program : " );
Name =input.next();
if(Name.equals("stop"))
break;
Merchandise merch = new Merchandise (Amount, Cost, Number, Name);
System.out.printf("Please enter the item number of %d : ", merch.getNumber());
Number =input.nextDouble();
System.out.printf("Please enter the amount of %d : ", merch.getAmount());
Amount = input.nextDouble();
System.out.printf("Please enter the amount of dollars each %d cost : ", merch.getAmount());
Cost = input.nextDouble();
System.out.printf("Product: %s Invetory Number: %d Units on hand: %d " +
"Each Unit Cost: %d The total value of %s is: %d",merch.getName(),
merch.getNumber(), merch.getAmount(), merch.getCost(),
merch.getName(), merch.getTCost());
}
while( ! (Name.equalsIgnoreCase("stop")) );
System.out.println("Program has been terminated"); //Program will terminate
}
}
}