Created
February 11, 2019 00:09
-
-
Save derjust/e7ce7312fa3aed29366a668e95fe1f43 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package assignment2; | |
public class ParkingMeter { | |
private int maxParkingInMinutes; | |
/** rate as in minutes per quarter */ | |
private int rate; | |
private int time; | |
public ParkingMeter(int pMaxParkingInMinutes, int pRate) { | |
maxParkingMinutes = pMaxParkingInMinutes; | |
rate = pRate; | |
time = 0; | |
} | |
public void insertQuarter() { | |
time = time + rate; | |
} | |
public int checkRemainingTime() { | |
return time; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment