Mini Projects Using C++
- ATM MACHINE
- DIGITAL CLOCK
This repository contains two C++ applications: a feature-rich ATM simulation system and a real-time digital clock. Both applications demonstrate various C++ programming concepts and provide interactive user interfaces.
The ATM simulation system is a comprehensive console-based application that mimics real ATM functionality with advanced security features and user-friendly interface.
- 🔐 Secure PIN authentication system
- 💰 Multiple transaction types
- 📝 Transaction history tracking
- ⚡ Fast cash options
- 🔒 Account security with lockout mechanism
- 💳 Multi-bank support
-
Account Structure
- Stores user data including:
- Card number
- PIN
- Balance
- Bank name
- Account holder name
- Transaction history
- Security-related fields (failed attempts, lock status)
- Stores user data including:
-
ATM Class
class ATM { private: map<char, Account> accounts; const int MAX_FAILED_ATTEMPTS = 3; const int LOCK_DURATION_MINUTES = 60; // ... private methods public: // ... public interface };
- PIN validation with retry limits
- Account lockout system (60-minute lockout after 3 failed attempts)
- Transaction logging with timestamps
- Masked card number display
-
Withdraw Money
- PIN verification
- Balance verification
- Transaction logging
-
Balance Check
- Secure balance display
- Transaction logging
-
Transaction History
- Chronological list of transactions
- Timestamp-based logging
-
Fast Cash
- Preset withdrawal amounts
- Quick access to common denominations
-
PIN Change
- Current PIN verification
- New PIN confirmation
- Length validation
# Compile the ATM application
g++ ATM_MACHINE.cpp -o atm
# Run the application
./atm
# Available test accounts:
- Card 'k': PIN 1234 (SBI Bank)
- Card 's': PIN 5678 (HDFC Bank)
- Card 'l': PIN 9123 (ICICI Bank)
- Card 'i': PIN 4567 (AXIS Bank)
- Card 'n': PIN 8912 (PNB Bank)
A real-time digital clock application that displays the current time and date with format switching capabilities.
- ⏰ Real-time updates
- 📅 Date display
- 🔄 12/24 hour format toggle
- 🖥️ Clean console interface
- DigitalClock Class
class DigitalClock { private: bool is24HourFormat; bool isRunning; // ... private methods public: DigitalClock(); void run(); };
-
Time Display
- Uses
chrono
andctime
for accurate time management - Formats time and date with proper padding
- Updates every second
- Uses
-
Format Toggle
- Switches between 12/24 hour format
- Handles AM/PM indication
- Maintains time accuracy during format changes
-
User Interface
- Clear screen implementation for different platforms
- Non-blocking input handling
- Continuous display updates
# Compile the Digital Clock application
g++ DIGITAL_CLOCK.cpp -o clock
# Run the application
./clock
# Controls:
- Press 'F' to toggle between 12/24 hour format
- Press 'Q' to quit the application
Both applications require:
- C++11 or higher
- Standard C++ libraries
- A C++ compiler (g++ recommended)
<iostream>
- For input/output operations<string>
- String manipulation<chrono>
- Time management<thread>
- Threading operations<iomanip>
- Output formatting
- C++ compiler (g++ recommended)
- Make (optional)
# ATM System
g++ ATM_MACHINE.cpp -o atm -std=c++11
# Digital Clock
g++ DIGITAL_CLOCK.cpp -o clock -std=c++11
- Modular class design
- Separation of concerns between UI and business logic
- Robust error handling
- Transaction logging system
- Single-responsibility principle
- Non-blocking input handling
- Platform-independent screen clearing
- Real-time updates
Feel free to fork this repository and submit pull requests. You can also open issues for bugs or feature requests.