Question: Write a C program that can manage checking and savings accounts. Requirements: - The program can keep track of a maximum of 1 0 accounts.
Write a C program that can manage checking and savings accounts.
Requirements:
The program can keep track of a maximum of accounts.
The program can create a bank account.
o It takes the following fields:
Account number should be a digit integer ex a number between
and
If the account number is already used by another account, the
program needs to ask a diOerent account number.
Account type checking or savings
You need to check the user input.
Holder name
The maximum length of the name is characters.
Open date string format: YYYYMMDD
You need to check the user input format.
Balance
Hint: Use a structure.
The program can deposit money into a bank account.
o The program prints out the remaining balance.
The format string is f
The program can withdraw money from a bank account.
o The program prints out the remaining balance.
The format string is f
The program can sort accounts by diOerent fields and print them.
o Hint: Use qsort function on Page of the textbook.
o Sorting fields: account number, holder name, open date and balance.
o To print the holder name, the format string is s
o To print the balance, the format string is f
Hint: Refer to inventoryc on Page of the textbook.
Example Interaction user input is underlined; your program must follow this format
precisely without the underline:
$ gcc Wall assignmentc
$
$
$aout
Main menu
create an account
deposit money
withdraw money
ssort and print accounts
quit program
Enter operation code c d w s q: c
Enter account number digits:
Enter a number between and
Enter account number digits:
Enter a number between and
Enter account number digits:
Enter account type: checking savings
c or s: d
Wrong account type. Enter c or s
Enter account type: checking savings
c or s: C
Enter account holder's name: John Smith
Enter open date YYYYMMDD:
Wrong date format.
Enter open date YYYYMMDD:
Wrong date format.
Enter open date YYYYMMDD:
Wrong date format.
Enter open date YYYYMMDD:
Enter balance number only: $
Account is created.
Main menu
create an account
deposit money
withdraw money
ssort and print accounts
quit program
Enter operation code c d w s q: c
Enter account number digits:
Enter account type: checking savings
c or s: S
Enter account holder's name: Emily Davis
Enter open date YYYYMMDD:
Enter balance number only: $
Account is created.
Main menu
create an account
deposit money
withdraw money
ssort and print accounts
quit program
Enter operation code c d w s q: s
Enter the sorting field: account number holder name open date balance
a h o or b: a
#### Type Holder name Open date Balance
C John Smith
S Emily Davis
Main menu
create an account
deposit money
withdraw money
ssort and print accounts
quit program
Enter operation code c d w s q: s
Enter the sorting field: account number holder name open date balance
a h o or b: h
#### Type Holder name Open date Balance
S Emily Davis
C John Smith
Main menu
create an account
deposit money
withdraw money
ssort and print accounts
quit program
Enter operation code c d w s q: s
Enter the sorting field: account number holder name open date balance
a h o or b: o
#### Type Holder name Open date Balance
S Emily Davis
C John Smith
Main menu
create an account
deposit money
withdraw money
ssort and print accounts
quit program
Enter operation code c d w
