class LotteryConsoleServiceImpl implements LotteryConsoleService {

  private final Logger logger;

  /**
   * Constructor.
   */
  public LotteryConsoleServiceImpl(Logger logger) {
    this.logger = logger;
  }

  @Override
  public void checkTicket(LotteryService service, Scanner scanner) {<FILL_FUNCTION_BODY>}

  @Override
  public void submitTicket(LotteryService service, Scanner scanner) {
    logger.info("What is your email address?");
    var email = readString(scanner);
    logger.info("What is your bank account number?");
    var account = readString(scanner);
    logger.info("What is your phone number?");
    var phone = readString(scanner);
    var details = new PlayerDetails(email, account, phone);
    logger.info("Give 4 comma separated lottery numbers?");
    var numbers = readString(scanner);
    try {
      var chosen = Arrays.stream(numbers.split(","))
          .map(Integer::parseInt)
          .collect(Collectors.toSet());
      var lotteryNumbers = LotteryNumbers.create(chosen);
      var lotteryTicket = new LotteryTicket(new LotteryTicketId(), details, lotteryNumbers);
      service.submitTicket(lotteryTicket).ifPresentOrElse(
          (id) -> logger.info("Submitted lottery ticket with id: {}", id),
          () -> logger.info("Failed submitting lottery ticket - please try again.")
      );
    } catch (Exception e) {
      logger.info("Failed submitting lottery ticket - please try again.");
    }
  }

  @Override
  public void addFundsToLotteryAccount(WireTransfers bank, Scanner scanner) {
    logger.info("What is the account number?");
    var account = readString(scanner);
    logger.info("How many credits do you want to deposit?");
    var amount = readString(scanner);
    bank.setFunds(account, Integer.parseInt(amount));
    logger.info("The account {} now has {} credits.", account, bank.getFunds(account));
  }

  @Override
  public void queryLotteryAccountFunds(WireTransfers bank, Scanner scanner) {
    logger.info("What is the account number?");
    var account = readString(scanner);
    logger.info("The account {} has {} credits.", account, bank.getFunds(account));
  }

  private String readString(Scanner scanner) {
    logger.info("> ");
    return scanner.next();
  }
}

    logger.info("What is the ID of the lottery ticket?");
    var id = readString(scanner);
    logger.info("Give the 4 comma separated winning numbers?");
    var numbers = readString(scanner);
    try {
      var winningNumbers = Arrays.stream(numbers.split(","))
          .map(Integer::parseInt)
          .limit(4)
          .collect(Collectors.toSet());

      final var lotteryTicketId = new LotteryTicketId(Integer.parseInt(id));
      final var lotteryNumbers = LotteryNumbers.create(winningNumbers);
      var result = service.checkTicketForPrize(lotteryTicketId, lotteryNumbers);

      if (result.getResult().equals(LotteryTicketCheckResult.CheckResult.WIN_PRIZE)) {
        logger.info("Congratulations! The lottery ticket has won!");
      } else if (result.getResult().equals(LotteryTicketCheckResult.CheckResult.NO_PRIZE)) {
        logger.info("Unfortunately the lottery ticket did not win.");
      } else {
        logger.info("Such lottery ticket has not been submitted.");
      }
    } catch (Exception e) {
      logger.info("Failed checking the lottery ticket - please try again.");
    }
  
<no_super_class>