هذه صفحة لقطة ثنائية اللغة تم حفظها بواسطة المستخدم في 2025-4-8 14:59 لـ https://app.immersivetranslate.com/pdf-pro/dd8ca269-5550-4bec-b875-e3362e0b1237/?isTrial=true، مقدمة بدعم ثنائي اللغة من قبل الترجمة الغامرة. تعلم كيفية الحفظ؟

Project Title:  اسم المشروع:

ATM System  نظام الصراف الآلي

Objective:  هدف:

To design and implement an ATM system using Object-Oriented Programming (OOP) principles in C++. The system will simulate common ATM functionalities such as balance inquiry, deposit, withdrawal, and PIN management. It will emphasize modular design with clear, reusable methods, ensuring the program is user-friendly and robust.
تصميم وتنفيذ نظام ATM باستخدام مبادئ البرمجة الشيئية (OOP) في C ++. سيحاكي النظام وظائف أجهزة الصراف الآلي الشائعة مثل الاستعلام عن الرصيد والإيداع والسحب وإدارة رقم التعريف الشخصي. سيؤكد على التصميم المعياري بطرق واضحة وقابلة لإعادة الاستخدام ، مما يضمن أن البرنامج سهل الاستخدام وقوي.

Requirements:  المتطلبات:

1. Functional Requirements:
1. المتطلبات الوظيفية:

  • Implement OOP principles such as:
    تنفيذ مبادئ OOP مثل:
  • Encapsulation: Use private data members and public methods for access control.
    التغليف: استخدم أعضاء البيانات الخاصة والأساليب العامة للتحكم في الوصول.
  • Modularity: Divide the ATM operations into well-defined methods.
    الوحدات: قسم عمليات ATM إلى طرق محددة جيدا.
  • The system must:  يجب أن يقوم النظام:
  • Authenticate users via PIN.
    مصادقة المستخدمين عبر رقم التعريف الشخصي.
  • Allow users to check their balance.
    اسمح للمستخدمين بالتحقق من رصيدهم.
  • Support deposits and withdrawals with proper validation.
    دعم عمليات الإيداع والسحب مع التحقق المناسب.
  • Enable PIN changes with error checks.
    قم بتمكين تغييرات رقم التعريف الشخصي من خلال التحقق من الأخطاء.
  • Provide a menu-driven interface.
    توفير واجهة قائمة تستمد إليها.

2. Non-Functional Requirements:
2. المتطلبات غير الوظيفية:

  • Avoid built-in functions for critical operations (e.g., binary operations or database functions).
    تجنب الوظائف المضمنة للعمليات الهامة (على سبيل المثال ، العمليات الثنائية أو وظائف قاعدة البيانات).
  • Ensure error handling for invalid inputs (e.g., incorrect PIN, insufficient balance).
    تأكد من معالجة الأخطاء للإدخالات غير الصالحة (على سبيل المثال، رقم التعريف الشخصي غير الصحيح أو عدم كفاية الرصيد).
  • Provide clear prompts and feedback for user actions.
    تقديم مطالبات وملاحظات واضحة لإجراءات المستخدم.
  • Use a loop to repeatedly display the menu until the user chooses to exit.
    استخدم حلقة لعرض القائمة بشكل متكرر حتى يختار المستخدم الخروج.

System Design:  تصميم النظام:

Class Design:  تصميم الفصل:

Class Name: ATM  اسم الفصل: أجهزة الصراف الآلي
Attribute A  السمة أ Access Modifier  معدل الوصول Type  نوع Description  وصف
pin Pr  دبوس العلاقات العامة Private  عسكري int  الباحث Stores the 4-digit PIN for authentication.
يخزن رقم التعريف الشخصي المكون من 4 أرقام للمصادقة.
balance Pr  التوازن العلاقات العامة Private  عسكري double  مزدوج Tracks the current account balance.
يتتبع رصيد الحساب الجاري.
Method Name  اسم الطريقة
  معدل الوصول
Access
Modifier
Access Modifier| Access | | :--- | | Modifier |
  نوع الإرجاع
Return
Type
Return Type| Return | | :--- | | Type |
Description  وصف
ATM (int, double)  أجهزة الصراف الآلي (int ، مزدوجة) Public  علني Constructor  منشئ Initializes the ATM object with a default PIN and balance.
تهيئة كائن ATM باستخدام رقم تعريف شخصي ورصيد افتراضيين.
showMenu() Public  علني void  خلاء Displays the list of available operations to the user.
يعرض قائمة العمليات المتاحة للمستخدم.
validatePIN(int)  validatePIN (int) Public  علني bool  بول Checks if the user-entered PIN matches the stored PIN.
يتحقق مما إذا كان رقم التعريف الشخصي الذي أدخله المستخدم يتطابق مع رقم التعريف الشخصي المخزن.
checkBalance() Public  علني void  خلاء Displays the current balance.
يعرض الرصيد الحالي.
deposit(double)  الإيداع (مزدوج) Public  علني void  خلاء Adds a specified amount to the account balance.
يضيف مبلغا محددا إلى رصيد الحساب.
withdraw(double)  سحب (مزدوج) Public  علني void  خلاء Deducts a specified amount from the account balance if sufficient funds are available.
يخصم مبلغا محددا من رصيد الحساب في حالة توفر أموال كافية.
changePIN(int)  changePIN (int) Public  علني void  خلاء Updates the PIN if the new one is valid.
يقوم بتحديث رقم التعريف الشخصي إذا كان رقم التعريف الشخصي الجديد صالحا.
runatm () Public  علني void  خلاء Main method to control the ATM operations and user interaction loop.
الطريقة الرئيسية للتحكم في عمليات ATM وحلقة تفاعل المستخدم.
Attribute A Access Modifier Type Description pin Pr Private int Stores the 4-digit PIN for authentication. balance Pr Private double Tracks the current account balance. Method Name "Access Modifier" "Return Type" Description ATM (int, double) Public Constructor Initializes the ATM object with a default PIN and balance. showMenu() Public void Displays the list of available operations to the user. validatePIN(int) Public bool Checks if the user-entered PIN matches the stored PIN. checkBalance() Public void Displays the current balance. deposit(double) Public void Adds a specified amount to the account balance. withdraw(double) Public void Deducts a specified amount from the account balance if sufficient funds are available. changePIN(int) Public void Updates the PIN if the new one is valid. runatm () Public void Main method to control the ATM operations and user interaction loop.| Attribute A | Access Modifier | Type | Description | | :---: | :---: | :---: | :---: | | pin Pr | Private | int | Stores the 4-digit PIN for authentication. | | balance Pr | Private | double | Tracks the current account balance. | | Method Name | Access <br> Modifier | Return <br> Type | Description | | ATM (int, double) | Public | Constructor | Initializes the ATM object with a default PIN and balance. | | showMenu() | Public | void | Displays the list of available operations to the user. | | validatePIN(int) | Public | bool | Checks if the user-entered PIN matches the stored PIN. | | checkBalance() | Public | void | Displays the current balance. | | deposit(double) | Public | void | Adds a specified amount to the account balance. | | withdraw(double) | Public | void | Deducts a specified amount from the account balance if sufficient funds are available. | | changePIN(int) | Public | void | Updates the PIN if the new one is valid. | | runatm () | Public | void | Main method to control the ATM operations and user interaction loop. |

Method-by-Method Explanation:
شرح طريقة تلو الأخرى:

1. Constructor (ATM(int, double)):
1. المنشئ (أجهزة الصراف الآلي (int ، مزدوج)):

  • Purpose: Initialize the ATM object with a default PIN and balance.
    الغرض: تهيئة كائن ATM باستخدام رقم تعريف شخصي ورصيد افتراضيين.
  • Parameters:  البارامترات:
  • int initialPIN: The initial PIN for the account.
    int initialPIN: رقم التعريف الشخصي الأولي للحساب.
  • double initialBalance: The initial balance for the account.
    الرصيد الأولي المزدوج: الرصيد الأولي للحساب.
  • Behavior:  سلوك:
  • Assigns initialPIN to the private pin attribute.
    يعين initialPIN إلى سمة الدبوس الخاص.
  • Assigns initialBalance to the private balance attribute.
    يعين initialBalance إلى سمة الرصيد الخاص.
  • Example Usage:  مثال على الاستخدام:

2. showMenu():  2. showMenu ():

  • Purpose: Display a list of available operations for the user.
    الغرض: عرض قائمة بالعمليات المتاحة للمستخدم.
  • Parameters: None.  المعلمات: لا شيء.
  • Return Type: void.  نوع العودة: باطل.
  • Behavior:  سلوك:
  • Outputs a menu with options like checking balance, depositing money, withdrawing money, changing PIN, and exiting.
    ينتج قائمة بخيارات مثل التحقق من الرصيد وإيداع الأموال وسحب الأموال وتغيير رقم التعريف الشخصي والخروج.
  • Example Output:  مثال على الإخراج:
====== ATM Main Menu
1. Check Balance
2. Deposit Money
3. Withdraw Money
4. Change PIN
5. Exit
\(=========================\)
  1. validatePIN(int inputPIN):
    validatePIN (int inputPIN):
  • Purpose: Verify if the entered PIN matches the stored PIN.
    الغرض: تحقق مما إذا كان رقم التعريف الشخصي الذي تم إدخاله يتطابق مع رقم التعريف الشخصي المخزن.
  • Parameters:  البارامترات:
  • int inputPIN: The PIN entered by the user.
    int inputPIN: رقم التعريف الشخصي الذي أدخله المستخدم.
  • Return Type: bool  نوع الإرجاع: بول
  • true: If the PIN is correct.
    true: إذا كان رقم التعريف الشخصي صحيحا.
  • false: If the PIN is incorrect.
    خطأ: إذا كان رقم التعريف الشخصي غير صحيح.
  • Behavior:  سلوك:
  • Compares inputPIN with the stored pin.
    يقارن إدخال PIN برقم التعريف الشخصي المخزن.
  • Example Usage:  مثال على الاستخدام:
if (myATM.validatePIN(1234)) {
    cout << "Access Granted";
} else {
    cout << "Access Denied";
}
  1. checkBalance():  checkBalance ():