Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Automobil extends Vozilo {
- /*
- * Automobil je vozilo koje troši gorivo na sledeći način:
- * (1.1*potrošnja)*predjeni_put. Moze se ispisati u sledećem obliku: Auto -
- * Ser_broj{reg_broj}[gorivo/rezervoar] - potrosnja L/100km
- */
- public Automobil(String regBr, String serBr, double velRez, double trenGor, double potrosnja) {
- super(regBr, serBr, velRez, trenGor, potrosnja);
- }
- public Automobil() {
- }
- @Override
- double getBrKm(double n) {
- double s = 0;
- if (this.getTrenGor() >0) {
- s = this.getTrenGor() * 100 / (1.1 * this.getPotrosnja());
- }
- return s;
- }
- @Override
- public void info() {
- System.out.println("Auto - " + this.getSerBr() + "{" + this.getRegBr() + "} [" + this.getTrenGor() + "/"
- + this.getVelRez() + "]" + " - " + this.getPotrosnja() + " L/100km");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement