Last active
February 20, 2019 21:02
-
-
Save EbbeVang/9717f04daccd0cff7a020345ba1ccbb4 to your computer and use it in GitHub Desktop.
Car interface
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
import javafx.scene.paint.Color; | |
public interface Car { | |
boolean isStarted(); | |
/** | |
* This method tells you whether the car is started or not | |
* @return true if the car i sstarted | |
*/ | |
boolean start(); | |
/** | |
* stop the engine | |
* @return true if it was turned on | |
*/ | |
boolean stop(); | |
double steerLeft(); | |
double steerRight(); | |
/** | |
* Use the engine to drive the car forward | |
* @param power how much power in percentage | |
* @return speed in km/h | |
*/ | |
double driveForward(int power); | |
/** | |
* Use the engine to drive the car backwards | |
* @param power how much power in percentage | |
* @return speed in km/h | |
*/ | |
double driveBackwards(int power); | |
/** | |
* get the car's licenseplate | |
* @return licensplate | |
*/ | |
String getLicensePlate(); | |
/** | |
* The color of the car | |
* @return the color of the car | |
*/ | |
Color getColor(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment