I don't understand

Hello all... I am completely lost here. Here is what the assignment is like. I have to make a program that prints 5 random delivery times like this:

Delivery 1 took _ minutes

Delivery 2 took __ minutes

Delivery 3 """"

Delivery 4 """"

Delivery 5 " " " "" "

import java.util.Random;

/* The library to import can be seen under the class name on the API page for the

Random class. There may be other classes to import as well.*/

public class GiveNameOfClassHere{ // Put in a meaningful class name

public static void main(String[] args){

// Declare variables and constants

Random randomClassInstanceNameHere = new Random(yourID);

// You are using the constructor Random(long seed)

// yourID is a constant.

//Now you can use any methods from the Random class

// For example:

randomClassInstanceNameHere.setSeed(2345654);

// This changes the seed to 2345654 (which is converted to a long type).

isTrue = randomClassInstanceNameHere.nextBoolean(); // true

// Based on the randomness, isTrue may be true here.

isTrue = randomClassInstanceNameHere.nextBoolean(); // true

// Based on the randomness, isTrue may be true here.

isTrue = randomClassInstanceNameHere.nextBoolean(); // false

// Based on the randomness, isTrue may be false here.

Here is what I have do far what are my errors so far and how do I set a delivery time equal to a random number

Do I need to make 5 variables Delivery1, Delivery 2, Delivery3, Delivery4, Deliery5?Someone please help I am completely lost.

[1629 byte] By [dukefan44a] at [2007-11-26 17:02:54]
# 1

When you post code, please use[code] and [/code] tags as described in [url=http://forum.java.sun.com/help.jspa?sec=formatting]Formatting tips[/url] on the message entry page. It makes it much easier to read.

Paste in the exact error messages and indicate which lines they're on. (Not by line number--we're not going to count your lines.)

jverda at 2007-7-8 23:30:41 > top of Java-index,Java Essentials,New To Java...
# 2
> Do I need to make 5 variables Delivery1, Delivery 2,> Delivery3, Delivery4, Deliery5?That would work.
CaptainMorgan08a at 2007-7-8 23:30:41 > top of Java-index,Java Essentials,New To Java...
# 3

> Do I need to make 5 variables Delivery1, Delivery 2,

> Delivery3, Delivery4, Deliery5?

If each delivery is taken care of completely before moving on to the next one, then, no, you don't need separate variables.

If you need to first do one thing with all deliveries, and then do something else with all those same deliveries (that is, go back to the first delivery after you've done something with 2nd-5th), then you need either 5 variables or an array or collection.

http://java.sun.com/docs/books/tutorial/java/nutsandbolts/arrays.html

http://java.sun.com/docs/books/tutorial/collections/

jverda at 2007-7-8 23:30:41 > top of Java-index,Java Essentials,New To Java...
# 4

Sorry here is what I have so far. I didnt paste it last time the other code above is what my program should be layed out like. How do I make the

delivery times I have declared get a random number? I am looking at the API for the random class and it makes no sense to me I don't know which method to use or anything.

import java.util.Random;

public class MilkDelivery {

public static void main(String[] args) {

int delivery1, delivery2, delivery3, delivery4, delivery5;

Random eagleID = new Random(900364417);

eagleID.setSeed(900364417);

System.out.println(eagleID);

}

}

dukefan44a at 2007-7-8 23:30:41 > top of Java-index,Java Essentials,New To Java...
# 5
Random randGen = new Random();int randomNum = randGen.nextInt(10);This code generates a random int from 0-10 inclusive (or 0-9).
CaptainMorgan08a at 2007-7-8 23:30:41 > top of Java-index,Java Essentials,New To Java...
# 6
So I greatly appreciate it I just need help getting started and I can finish the program how do I make my variable int delivery1 equal a random number with using my ID? Like it is supposed to get random numbers out of my student ID and mine is 90050674.
dukefan44a at 2007-7-8 23:30:41 > top of Java-index,Java Essentials,New To Java...
# 7
I mean my id is 900364417 sorry.
dukefan44a at 2007-7-8 23:30:41 > top of Java-index,Java Essentials,New To Java...