Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Help me to add age,identity card number,phone number and address in account creation in this coding..and also when it came to deposite and withdraw it

Help me to add age,identity card number,phone number and address in account creation in this coding..and also when it came to deposite and withdraw it automatically terminate..pls help to solve that..

#include #include void creation( ) ; void deposit( ) ; void withdraw( ) ; void lowbal( ) ; int a = 0 , i = 1001 ; struct bank { int no ; char name[20] ; int age; char address[60]; float bal ; float dep ; } s[100];

int main( ) { int ch ; do { printf(" ********** ") ; printf(" BANKING ") ; printf(" ********** ") ; printf(" 1. Create New Account ") ; printf(" 2. Cash Deposit ") ; printf(" 3. Cash Withdraw ") ; printf(" 4. Low Balance Enquiry ") ; printf(" 5. Exit ") ; printf(" Enter your choice : ") ; scanf("%d ",& ch) ; switch ( ch) { case 1 : creation( ) ; break ; case 2 : deposit( ) ; break ; case 3 : withdraw( ) ; break ; case 4 : lowbal( ) ; break ; case 5 : ; break ; defalut : printf(" Choice a Valid option !! ") ; break ; getch( ) ; }} while( ch != 5 ) ; }

void creation( ) { printf(" ********** ") ; printf(" NEW ACCOUNT CREATION ") ; printf(" ********** ") ; printf(" Your Account Number is :%d ",i) ; s[a].no = i ; printf(" Enter your Name : ") ; scanf("%s ",& s[a].name) ; printf(" Your Deposit is Minimum RM.20") ; s[a].dep=20 ;a++ ; i++ ; getch( ) ; } void deposit( ) { int no, b = 0, m = 0 ; int aa ; printf(" ********** ") ; printf(" CASH DEPOSIT ") ; printf(" ********** ") ; printf(" Enter your Account Number : ") ; scanf("%d ",& no) ; for ( b = 0 ; b < i ; b++) { if ( s[b].no == no) m = b ;} if ( s[m].no == no) { printf(" Account Number : %d ",s[m].no) ; printf(" Name : %s ",s[m].name) ; printf(" Deposit : %f ",s[m].dep) ; printf(" Deposited Amount : ") ; scanf("%f ",&aa) ; s[m].dep+=aa ; printf(" The Balance in Account is : %f ",s[m].dep) ; getch( ) ; } else { printf(" ACCOUNT NUMBER IS INVALID ") ; getch( ) ; } } void withdraw( ) { int no, b = 0, m = 0 ; int aa ; printf(" ********** ") ; printf(" CASH WITHDRAW ") ; printf(" ********** ") ; printf(" Enter your Account Number : ") ; scanf("%d ",& no) ; for ( b = 0 ; b < i ; b++) { if ( s[b].no == no) m = b ;} if ( s[m].no == no) { printf(" Account Number : %d ",s[m].no) ; printf(" Name : %s ",s[m].name) ; printf(" Deposit : %f ",s[m].dep) ; printf(" Withdraw Amount : ") ; scanf("%f ",& aa) ; if ( s[m].dep < aa+500) { printf(" CANNOT WITHDRAW YOUR ACCOUNT HAS MINIMUM BALANCE ") ; getch( ) ; } else { s[m].dep-=aa ; printf(" The Balance Amount in Account is : %f ",s[m].dep) ; } } else { printf(" ACCOUNT NUMBER IS INVALID ") ; getch( ) ; }

getch( ) ; } void lowbal( ) { int no, b = 0, m = 0 ; int aa ; printf(" ********** ") ; printf(" FOLLOWING ACCOUNT HOLDER'S BALANCE IS LESS THAN 1000 ") ; printf(" ********** ") ; for ( b = 0 ; b < a ; b++) { if ( s[b].dep < 1000) { printf(" Account Number : %d ",s[b].no) ; printf(" Name : %s ",s[b].name) ; } } getch( ) ; }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions