02-09-2005, 07:43 PM
|
#1
|
|
Member (7 bit)
Join Date: Nov 2003
Posts: 76
|
java help
Its suppose to look like this example http://sbs.cs.olemiss.edu/111spring2005/prog04.html
Code:
// exercise #4 starting point
import TerminalIO.KeyboardReader;
public class EventTimer {
public static void main(String [] args) {
int firstOccurrence;
int secondOccurrence;
int days;
int hours;
int mins;
int seconds;
KeyboardReader rdr = new KeyboardReader();
firstOccurrence = (int)(Math.random()*1000000);
secondOccurrence = firstOccurrence + (int)(Math.random()*1000000);
System.out.print( "The first event occurred at time = " );
System.out.println( firstOccurrence );
System.out.print( "The second event occurred at time = " );
System.out.println( secondOccurrence );
rdr.pause();
}
}
System.out.println("The second event occured:")
|
|
|