// controller.js class WalletController { constructor(model, view) { this.model = model; this.view = view; } async start() { let running = true; while (running) { this.view.displayBalance(this.model.getBalance()); this.view.displayMenu(); const choice = await this.view.getChoice(); switch (choice) { case '1': const addAmount = await this.view.getAmount(); this.model.addMoney(addAmount); break; case '2': const subtractAmount = await this.view.getAmount(); this.model.subtractMoney(subtractAmount); break; case '3': running = false; this.view.close(); break; default: console.log('Érvénytelen választás, próbálja újra.'); break; } } console.log('Viszlát!'); } } module.exports = WalletController;