Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class maiwnOWO {
- public static void main(String[] args)
- {
- Scanner Scan = new Scanner(System.in);
- boolean ripeti = true;
- double Carburante;
- Motorino owo = new Motorino();
- while(ripeti)
- {
- int request = Scan.nextInt();
- switch(request) //1 = Accendi; 2 = Spegni; 3 = Accelera; 4 = Frena; 5 = Carburante
- {
- case 1:
- owo.Accendi();
- break;
- case 2:
- owo.Spegni();
- break;
- case 3:
- System.out.println(owo.Accelera());
- System.out.println(owo.getVelocita());
- System.out.println(owo.getCarburante());
- break;
- case 4:
- System.out.println(owo.Frena());
- System.out.println(owo.getVelocita());
- break;
- case 5:
- System.out.println(owo.getCarburante());
- System.out.println(owo.getCapacitaSerbatoio());
- System.out.println("Inserire carburante da rifornire");
- Carburante = Scan.nextDouble();
- owo.Rifornisci(Carburante);
- break;
- default:
- ripeti = false;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement