• Create a product class that holds the item number, the name of the product, the number of units in stock, and the price of each unit.
• Create a Java application that displays the product number, the name of the product, the number of units in stock, the price of each unit, and the value of the inventory (the number of units in stock multiplied by the price of each unit). Pay attention to the good programming practices in the text to ensure your source code is readable and well documented.
• Post as an attachment.
I am taking my first Java programing course, I have read the matirial, BUT I still can not get this program to would here is what I have so far:
// InventoryProgramPart1 08/25/2007
// This program keeps trak of DVD's.
public class InventoryProgramPart1
{
public static void main( String args[] )
{
int array[] = { 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50 }; //declare array named array
System.out.printf( "%s %8s %8s%8s %8s\n", "Movie", "Movie Name", "Units In Stock", "Price", "Total Value" ); // column headings
//output array ellemt's value
for ( int counter = 1; counter < array.length; counter++ )
System.out.printf( "%5d%8d\n", counter, array[ counter ] );
} //end main
} //end class InventoryProgramPart1
edit: code tagsI know it is not much but it is the best I can do. Can I Pls get some help?
This post has been edited by PennyBoki: 01 September 2007 - 09:27 AM

New Topic/Question
Reply



MultiQuote



|