Skip to content

Rezamollaei/Banking_programm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This C++ program simulates a simple bank account system, allowing the user to view the balance, deposit money, or withdraw money from their account. Here's an overview of the main features:

Key Functions:

function prompts the user to input an amount to deposit. If the entered amount is greater than zero, the deposit is valid, and it returns the amount to be added to the balance. If the amount is zero or negative, it returns 0 and prints an error message. withdraw(double balance):

function prompts the user to input an amount to withdraw. If the withdrawal amount exceeds the current balance, it prints an "insufficient funds" message and returns 0. If the amount is less than 0, it prints an error message and returns 0. Otherwise, it returns the withdrawal amount to deduct from the balance. showbalance(double balance):

function displays the current balance of the account, formatted to two decimal places using std::setprecision(2) and std::fixed. Main Loop:

The main loop allows the user to interact with the system by choosing from four options: showing balance, depositing money, withdrawing money, or exiting. After each operation, it clears the input buffer and asks the user for another action until they choose to exit. Observations & Suggestions for Improvement: Input Validation:

Conclusion: This program implements a basic banking system with the ability to view balance, deposit, and withdraw funds. It is functional but could benefit from better input handling and enhanced user experience (such as prompting for valid input if a wrong value is entered).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors