Exemplo n.º 1
0
 public void printAllCars() {
   Iterable<Car> cars = manager.getAllCars();
   System.out.println("Series  Brand  Power  Id");
   for (Car car : cars) {
     System.out.println(
         car.getSeries() + "  " + car.getBrand() + "  " + car.getPower() + "  " + car.getId());
   }
 }
Exemplo n.º 2
0
 public void login() {
   System.out.println("User name:");
   Scanner input = new Scanner(System.in);
   String userName = input.nextLine();
   System.out.println("Password:"******"Welcom " + client.getUserName());
   }
 }
Exemplo n.º 3
0
  private void addClient() {
    try {
      Scanner input = new Scanner(System.in);
      System.out.println("Fullname:");
      String fullName = input.nextLine();
      System.out.println("VIP:");
      boolean vip = input.nextBoolean();
      System.out.println("User name:");
      String userName = input.nextLine();
      System.out.println("Password:"******"Validation exception" + vex);
    }
  }
Exemplo n.º 4
0
 private void addCar() {
   try {
     Scanner input = new Scanner(System.in);
     System.out.println("Brand:");
     String brand = input.nextLine();
     System.out.println("Series:");
     String series = input.nextLine();
     System.out.println("Color:");
     String color = input.nextLine();
     System.out.println("Reg number:");
     String regNumber = input.nextLine();
     System.out.println("Power:");
     int power = input.nextInt();
     System.out.println("Price per hour:");
     int price = input.nextInt();
     Date d = new Date();
     manager.addCar(brand, series, color, regNumber, power, price, d);
   } catch (ValidationException vex) {
     System.out.println("Validation exception" + vex.getMessage());
   }
 }