Example 1: ATM Simulation

Rumman Ansari   Software Engineer   2025-08-31 03:32:17   166  Share
Subject Syllabus DetailsSubject Details
☰ TContent
☰Fullscreen

Table of Content:

Problem Statement

Banks provide ATM machines where customers can perform transactions like check balance, deposit, withdraw money, and exit. Customers must enter the correct PIN to access their account. If a customer enters the wrong PIN more than 3 times, their account should be locked.

The system should repeatedly show a menu until the customer chooses to exit. The program must also check whether the withdrawal amount is greater than the available balance.

Control Flow Used:

  • while loop for PIN verification

  • if-else for PIN attempts and withdrawal check

  • switch for transaction menu

  • do-while loop for repeating the menu




Stay Ahead of the Curve! Check out these trending topics and sharpen your skills.