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()); } }
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()); } }
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); } }
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()); } }