SpeedSetter
, TripSetter
,
DetailedTripSetter
, and
DetailedSpeedSetter
. For this assignment you must combine
them into one application called DashboardSetter
.
It must be possible to start this application with between 1 and 4
command-line arguments.
If the application is passed two arguments the first will be the current speed and there are two possibilities for the second.
If the second argument is a number it is the speed limit in km/hr.
If the second argument is not a number then the application must ignore the speed limit (i.e., not check to see if it is being exceeded).
If the application is passed three arguments the first contains the current speed in mi/hr, the second contains the trip distance in ft, and the third contains the trip duration in hr. The application must ignore the speed limit.
If the application is passed four arguments the first contains the current speed in mi/hr, the second contains the trip distance in ft, and the third contains the trip duration in hr. There are two possibilities for the fourth argument.
If the fourth argument is a number it is the speed limit in km/hr.
If the fourth argument is not a number then the application must ignore the speed limit (i.e., not check to see if it is being exceeded).
Text
class for converting
String
objects to numbers return a special value if the
String
can't be converted.
Also remember, elegance matters. To make your implementation elegant, you may need to add functions to your classes.
Copyright 2013