示例#1
0
  @Override
  public void execute() throws InterruptOperationException {
    ConsoleHelper.writeMessage(res.getString("exit.question.y.n"));

    if (ConsoleHelper.readString().equals(res.getString("yes"))) {
      ConsoleHelper.writeMessage(res.getString("thank.message"));
    }
  }
 @Override
 public void execute() throws InterruptOperationException {
   String cod = ConsoleHelper.askCurrencyCode();
   String[] data = ConsoleHelper.getValidTwoDigits(cod);
   CurrencyManipulator manipulator = CurrencyManipulatorFactory.getManipulatorByCurrencyCode(cod);
   try {
     manipulator.addAmount(Integer.parseInt(data[0]), Integer.parseInt(data[1]));
   } catch (Exception e) {
   }
 }
  @Override
  public void execute() {

    Collection<CurrencyManipulator> factory =
        CurrencyManipulatorFactory.getAllCurrencyManipulators();
    if (factory.isEmpty()) ConsoleHelper.writeMessage(res.getString("no.money"));
    else {
      for (CurrencyManipulator manipulator : factory) {
        if (!manipulator.hasMoney()) ConsoleHelper.writeMessage(res.getString("no.money"));
        else
          ConsoleHelper.writeMessage(
              manipulator.getCurrencyCode() + " - " + manipulator.getTotalAmount());
      }
    }
  }
 public static void printExitMessage() {
   ConsoleHelper.writeMessage(res.getString("the.end"));
 }
 public static void printExitMessage() {
   ConsoleHelper.writeMessage("Bye!");
 }