Elon's Toy Car

in #ita26 days ago

public class ElonsToyCar {
private int distance = 0;
private int battery = 100;
public static ElonsToyCar buy() {
ElonsToyCar car = new ElonsToyCar();
return car;
}

public String distanceDisplay() {
    return "Driven " +distance + " meters";
}

public String batteryDisplay() {
    return battery==0 ? "Battery empty":"Battery at " + battery+ "%";
}

public void drive() {
  if(battery!=0)
  {
   battery -= 1;
   distance +=20; 
  }      
}

}

Sort:  

Thank you, friend!
I'm @steem.history, who is steem witness.
Thank you for witnessvoting for me.
image.png
please click it!
image.png
(Go to https://steemit.com/~witnesses and type fbslo at the bottom of the page)

The weight is reduced because of the lack of Voting Power. If you vote for me as a witness, you can get my little vote.

Coin Marketplace

STEEM 0.28
TRX 0.12
JST 0.032
BTC 65848.40
ETH 3007.80
USDT 1.00
SBD 3.73