30 likes | 77 Views
FOR MORE CLASSES VISIT<br>tutorialoutletdotcom <br><br>Write an application or applet that implements a trip-time calculator. Define and use a<br>class TripComputer to compute the time of a trip. TripComputer should have the private<br>attributes<br>• totalTime—the total time for the trip<br>• restStopTaken—a boolean flag that indicates whether a rest stop has been taken at<br>the end of the current leg<br>
E N D
ITK 168 Write an application or applet • FOR MORE CLASSES VISIT • tutorialoutletdotcom • Write an application or applet that implements a trip-time calculator. Define and use aclass TripComputer to compute the time of a trip. TripComputer should have the privateattributes• totalTime—the total time for the trip• restStopTaken—a boolean flag that indicates whether a rest stop has been taken atthe end of the current legand the following methods:• computeLegTime(distance, speed)—computes the time for a leg of the triphaving a given distance in miles and speed in miles per hour.