BWiz
09-25-2008, 01:03 AM
I'm coding a little program that calculates the difference between an arrival time and departure time. Below is a little snippet of the app that calculates the difference:
public int DifferenceInHours(int Departure, int Arrival) {
int difference = 0;
if ( Departure >= Arrival ) {
System.out.println("The times you entered seemed to be incorrect.");
// I want to stop here...
}
difference = Arrival - Departure;
return difference;
}
Now say, if the departure time is greater than the arrival time, how would I stop the application completely from processing any further?
Thanks,
BWiz.
public int DifferenceInHours(int Departure, int Arrival) {
int difference = 0;
if ( Departure >= Arrival ) {
System.out.println("The times you entered seemed to be incorrect.");
// I want to stop here...
}
difference = Arrival - Departure;
return difference;
}
Now say, if the departure time is greater than the arrival time, how would I stop the application completely from processing any further?
Thanks,
BWiz.