1- #include <stdio.h>
2- #include <stdlib.h>
3- #include "BankAccount.h"
4-
5- int main () {
6- BankAccount * john = create_account ("John Doe" , 500.0 );
7- BankAccount * jane = create_account ("Jane Doe" , 500.0 );
8-
9- printf ("\nInitial Balances:\n" );
10- printf ("-----------------------\n" );
11- display_account (john );
12- display_account (jane );
13-
14- printf ("\nTransactions:\n" );
15- printf ("-----------------------\n" );
16-
17- printf ("Depositing $200.00 into John Doe's account:\n" );
18- deposit (john , 200.0 );
19-
20- printf ("Depositing $1.00 into Jane Doe's account:\n" );
21- deposit (jane , 1.0 );
22-
23- printf ("Withdrawing $700.00 from John Doe's account:\n" );
24- withdraw (john , 700.0 );
25-
26- printf ("Withdrawing $239.00 from Jane Doe's account:\n" );
27- withdraw (jane , 239.0 );
28-
29- printf ("Attempting to withdraw $50.00 from John Doe's account:\n" );
30- withdraw (john , 50.0 );
31-
32- printf ("Withdrawing $50.00 from Jane Doe's account:\n" );
33- withdraw (jane , 50.0 );
34-
35- printf ("\nFinal Balances:\n" );
36- printf ("-----------------------\n" );
37- display_account (john );
38- display_account (jane );
39-
40- free (john );
41- free (jane );
42-
43- return 0 ;
1+ #include <stdio.h>
2+ #include <stdlib.h>
3+ #include "BankAccount.h"
4+
5+ int main () {
6+ BankAccount * john = create_account ("John Doe" , 500.0 );
7+ BankAccount * jane = create_account ("Jane Doe" , 500.0 );
8+
9+ printf ("\nInitial Balances:\n" );
10+ printf ("-----------------------\n" );
11+ display_account (john );
12+ display_account (jane );
13+
14+ printf ("\nTransactions:\n" );
15+ printf ("-----------------------\n" );
16+
17+ printf ("Depositing $200.00 into John Doe's account:\n" );
18+ deposit (john , 200.0 );
19+
20+ printf ("Depositing $1.00 into Jane Doe's account:\n" );
21+ deposit (jane , 1.0 );
22+
23+ printf ("Withdrawing $700.00 from John Doe's account:\n" );
24+ withdraw (john , 700.0 );
25+
26+ printf ("Withdrawing $239.00 from Jane Doe's account:\n" );
27+ withdraw (jane , 239.0 );
28+
29+ printf ("Attempting to withdraw $50.00 from John Doe's account:\n" );
30+ withdraw (john , 50.0 );
31+
32+ printf ("Withdrawing $50.00 from Jane Doe's account:\n" );
33+ withdraw (jane , 50.0 );
34+
35+ printf ("\nFinal Balances:\n" );
36+ printf ("-----------------------\n" );
37+ display_account (john );
38+ display_account (jane );
39+
40+ free (john );
41+ free (jane );
42+
43+ return 0 ;
4444}
0 commit comments