Fargus811 / Competition

0 stars 0 forks source link

CoachService createCoach method formatting #17

Closed VladOsipov closed 4 years ago

VladOsipov commented 4 years ago

From my point, it would be better to group some lines. Empty lines dont give readability in your case

I can suggest something like:

public void createCoach() {
        Coach coach = new Coach();
        Scanner scanner = new Scanner(System.in);

        System.out.println("Ввeдите фамилию тренера");
        coach.setFirstname(scanner.next());

        System.out.println("Введите имя тренера");
        coach.setLastName(scanner.next());

        System.out.println("Введите востраст тренера");
        coach.setAge(scanner.nextInt());

        System.out.println("Введите пол тренара: MALE или FEMALE");
        coach.setSex(Sex.valueOf(scanner.next()));

        System.out.println("Введите старну тренера");
        coach.setCountry(scanner.next());

        System.out.println("Введите стоимость одной тренировки");
        coach.setCost();

        coachRepository.save(coach);
}
Fargus811 commented 4 years ago

Done.