|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--Macchina
Una macchina ha un serbatoio a cui si può aggiungere carburante che viene consumato in funzione dei kilometri percorsi secondo un parametro che ne stabilisce il consumo e che viene assegnato all'istanza alla creazione.
| Constructor Summary | |
Macchina(double un_consumo)
Costruisce una macchina con gas 0 e un dato livello di consumo. |
|
| Method Summary | |
void |
aggiungiGas(double ammontare)
Aggiunge carburante al serbatoio. |
double |
livello()
Ispeziona il livello del carburante. |
void |
percorri(double distanza)
Percorre una data distanza in kilometri. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Macchina(double un_consumo)
| Method Detail |
public void aggiungiGas(double ammontare)
ammontare - la quantità di carburante aggiuntapublic void percorri(double distanza)
distanza - i kilometri percorsipublic double livello()
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||