Skip to content

Instantly share code, notes, and snippets.

@EbbeVang
Last active February 20, 2019 21:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EbbeVang/9717f04daccd0cff7a020345ba1ccbb4 to your computer and use it in GitHub Desktop.
Save EbbeVang/9717f04daccd0cff7a020345ba1ccbb4 to your computer and use it in GitHub Desktop.
Car interface
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