Click to See Complete Forum and Search --> : Java assignment


philortals
04-15-2005, 12:34 PM
I have a Java program assignment due in a couple of days. I am lost. Can someone please help. Thank you in advance for the help.

Here is the assignment.

Jeff asks you to create a small Java program that loops through an array of toys ordered as a start to the inventory automation project. For now, he says you can use a sample list of possible items. The items you choose for the inventory list are ball, bat, bear, car, doll, game, glove, playstation, and train. In your sample program, keep a tally of the different items. If the item has already been mentioned, just increment that count as opposed to creating a new count for that item. You remember Jeff mentioning that orders for more than 4 items can sometimes cause stock outages. To alert the shipping department of situations where outages might occur, you decide to put an asterisk (*) before any item for which the customer has requested a quantity of 5 or more. At the end, print to the screen a summary of the items and their total count.

(Hint: Use myArray.length to determine how long the order input array is. Use System.out.print() to print a portion of an output line, and use System.out.println() to print a line and the carriage return to the next line. Make sure you handle the case where the inventory item description is not among those listed above – such as could happen with a typo or error.)

Here is your order input array: "bear," "train," "car," "ball," "doll," "ball," "train," "doll," "game," "train," "bear," "doll," "train," "car," "ball," "bat," "glove," "bat," "b," "doll," "bear," "ball," "doll," "bat," "car," "glove," "train," "doll," "bear"

ray326
04-16-2005, 02:32 PM
We'll help with questions about the code you have developed but we won't do your assignment for you.

7stud
04-17-2005, 01:12 AM
You need to try to write some code--even if it's only a few lines, and then post the problem you are having with writing the next couple of lines.