← Back

Code Challenge 2.5 - ATM Validation 🏧💳


Objective

An ATM is a machine that allows banking customers to easily access their bank accounts. It performs three basic tasks:

Performing validation means to verify that the input from the user is in the correct form. For example, when depositing money, a user cannot deposit a dollar amount less than or equal to 0. Also, when withdrawing money, a user can neither widraw an amount less than or equal to zero or an amount greater than their balance.

Your task is to improve upon your previous ATM application by implementing data validation. The goal is to ensure that user inputs for withdrawals and deposits are valid and within acceptable ranges.

Skills to Practice

Challenge Tasks

Sample Output

--- ATM ---
Please select an option:
1. Inquire Balance
2. Deposit
3. Withdraw
4. Exit
Choice: 2 [Enter]

Enter the amount to deposit: -50 [Enter]
Invalid amount. Please enter an amount greater than $0.

Enter the amount to deposit: 100 [Enter]
Deposit successful. Your new balance is $600.00.

Would you like to perform another transaction? (yes/no): yes [Enter]