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