Here is the code that runs beautifully!
public class cdinventory
{
String cdName;
int itemNumber;
int quantity;
double unitPrice;
public void setCdName (String name)
{
cdName = name;
}//end setCdName
public void setItemNumber (int number)
{
itemNumber = number;
}//end setItemNumber
public void setQuantity (int quant)
{
quantity = quant;
}//end setQuantity
public void setUnitPrice (double price)
{
unitPrice = price;
}//end setUnitPrice
public String getCdName ()
{
return cdName;
}//end getCdName
public int getItemNumber ()
{
return itemNumber;
}//end getItemNumber
public int getQuantity ()
{
return quantity;
}//end getQuantity
public double getUnitPrice ()
{
return unitPrice;
}//end getUnitPrice
public class artist extends cdinventory
{
String artistName;
public void setArtistName (String artist)
{
artistName = artist;
}//end setArtistName
public String getArtistName ()
{
return artistName;
}//end getArtistName
}//end class artist
public static void main (String[] args)
{
cdinventory cd = new cdinventory();
cd.setCdName (" ");
cd.setItemNumber (000);
cd.setQuantity (10);
cd.setUnitPrice (5.99);
System.out.println("CD Name: " + cd.getCdName());
System.out.println("CD Number: " + cd.getItemNumber());
System.out.println("Number in stock: " + cd.getQuantity());
System.out.println("Price each:$ " + cd.getUnitPrice());
int quantity = 0;
double unitPrice = 0.00;
double inventoryValue = quantity * unitPrice;
System.out.println("The value of the inventory for this cd is:$ "+ inventoryValue);
int [] inventory;
inventory = new int [1000];
}//end method main
}//end class cdinventory
I am starting to get excited! I think I can finally see the light at the end of the tunnel!!!
If someone can just guide me in how to do the calculations and GUI I will be done!
This post has been edited by lindy87124: 15 June 2007 - 08:34 PM

New Topic/Question
Reply



MultiQuote





|