Question: package Main; public class Vehicle { private String license; / / license plate private int hour; / / hour ( 2 4 hour time )

package Main;
public class Vehicle {
private String license; // license plate
private int hour; // hour (24 hour time)
private int minutes; // minutes (0..59)
public Vehicle()
{ license =""; hour =0; minutes =0;
}
public Vehicle(String s, int h, int m)
{ license = s; hour = h; minutes = m;
}
public String getLicense(){
return license; }
public void setLicense(String license){
this.license = license; }
public int getHour(){
return hour; }
public void setHour(int hour){
this.hour = hour; }
public int getMinutes(){
return minutes; }
public void setMinutes(int minutes){
this.minutes = minutes; }
// return string representation of data
public String toString ()
{ return license +""+ hour +":"+ minutes;
}
// return true if other car has same license as object
public boolean equals(Object other)
{ Vehicle temp =(Vehicle)(other);
return temp.getLicense().equals(license);
}
}This interactive program uses a sentinel controlled while loop, using sentinel "Q" to stop the loop. Here
is an example of writing an algorithm. I suggest you write your algorithm to designate the tasks and
their order in English prior to coding.
Code can assume valid data is entered so no error checking is needed. The workday runs from 06:00 to
18:00 so no code needs to be written to process times that cross midnight
package Main; public class Vehicle { private

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!