Results 1 to 4 of 4
Thread: Need help with school work
- 08-29-2009, 06:26 AM #1
Member
- Join Date
- Aug 2009
- Posts
- 1
- Rep Power
- 0
Need help with school work
I need help with my school work. I have to do a program by Sunday night and I don't even know how to begin. The first part of the assignment os Creat 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). This is what I have so far. I don't know if it is right or not can someone please help?!?!?!?!
/**
* @(#)Inventory.java
*
* Inventory application
*
* @author
* @version 1.00 2009/8/28
*/
import java.util.Scanner; //program uses class Scanner
public class Inventory {
//main method begins execution of Java application
public static void main( String args [])
{
//create scanner to obtain input from command window
Scanner input = new Scannner( System.in );
int itemNumber; //item number
int productNumber; //product number
int unitsInStock; //first number to mulitply
int priceOfEach; //second number to mylitply
int total; //total of unitsInStock * priceOfEach
System.out.print( "Enter item number: " );
//promt itemNumber=input.nextInt(); read input from user
System.out.print( "Enter product number: " );
//promt productNumber=input.nextInt(); read input from user
System.out.print( "Enter units in stock: " );
//promt unitsInStock=input.nextInt(); read input from user
System.out.print( "Enter price of each: " );
//promt priceOfEach=input.nextInt(); read input from usre
total=unitsInStock*priceOfEach;
//multiply unitsInStock and priceOfEach to get total value of stock
System.out.printf( "Total value of stock is %2f\n",total ); //display total amount
}//end main method
}//end class Inventory
- 08-29-2009, 06:39 AM #2
- 08-29-2009, 07:34 AM #3
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
Well then does it work as per the specifications? Did you compile and run it to see?
- 08-29-2009, 07:14 PM #4
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
And if you comes with any errors just post it here to see.
Similar Threads
-
Reord management for a school
By 435.mahesh in forum Advanced JavaReplies: 4Last Post: 03-22-2009, 02:59 PM -
school project help
By justin8790 in forum New To JavaReplies: 5Last Post: 03-22-2009, 09:54 AM -
Taking Java In School Need Help
By xEuPhOrIcSx in forum New To JavaReplies: 7Last Post: 02-04-2008, 08:02 AM -
Beginner Needs Help w/ Program for School
By badness in forum New To JavaReplies: 2Last Post: 11-24-2007, 07:51 PM -
Please help... assignment for school
By confused2000 in forum New To JavaReplies: 3Last Post: 11-12-2007, 08:12 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks