import java.io.*;
import java.util.*;
public class Buses
{
public Buses()
{
System.out.println("Please enter Destination:");
ReadIn in = new ReadIn();
String s = in.readString();
System.out.println("Your destination is:");
System.out.println("\n" + s);
System.out.println("Your departure time:");
System.out.println("Your arrival time:");
}
public static void main(String args[])
{
new Buses();
Journey busJourney[] = new Journey[15];
busJourney[0] = new Journey(9.25,"Thornhill",9.50);
busJourney[1] = new Journey(9.55,"Newport",10.20);
busJourney[2] = new Journey(10.00,"Llanishen",10.25);
busJourney[3] = new Journey(10.10,"Thornhill",10.35);
busJourney[4] = new Journey(10.25,"Llanishen",10.50);
busJourney[5] = new Journey(10.35,"Thornhill",11.00);
busJourney[6] = new Journey(10.55,"Pembroke",11.15);
busJourney[7] = new Journey(11.05,"Thornhill",11.35);
busJourney[8] = new Journey(11.25,"Newport",11.55);
busJourney[9] = new Journey(11.50,"Llanishen",12.10);
busJourney[10] = new Journey(12.05,"Thornhill",12.25);
busJourney[11] = new Journey(12.20,"Llanishen",12.45);
busJourney[12] = new Journey(12.35,"Thornhill",13.00);
busJourney[13] = new Journey(12.55,"Pembroke",13.10);
busJourney[14] = new Journey(13.20,"Thornhill",13.35);
}
}
class ReadIn {
static InputStreamReader is = new InputStreamReader( System.in );
static BufferedReader br = new BufferedReader( is );
StringTokenizer st;
StringTokenizer getToken() throws IOException
{
String s = br.readLine();
return new StringTokenizer(s);
}
String readString()
{
try
{
return br.readLine();
}
catch (IOException ioe)
{
System.err.println("IO Exception in ReadIn.readString");
return "";
}
}
}
public class Journey
{
Double fdeparture;
String fdestination;
Double farrival;
public Journey(Double departure, String destination, Double arrival)
{
fdeparture = departure;
fdestination = destination;
farrival = arrival;
}
}
Your help will be very much apprciated and i am eager to learn how to do these tasks.

New Topic/Question
Reply




MultiQuote



|