Description
PROJECT INSTRUCTIONS
The program name shall be bankacct.
It shall operate in two modes: interactive and command-line mode.
To launch the program in a Linux window, the user could type:
PROGRAM OUTPUT: BANK ACCOUNT DATABASE FILE
The program shall produce a text file that holds the bank account database.
When it is first started, the program shall inquire if a database file already exists, and what its name is.
If the file exists, it shall be opened for reading and writing.
If not, a new file of that name shall be opened for output.
Upon program exit, the output file shall be closed.
BANK ACCOUNT DATABASE FILE FORMAT
Here is the format for one record of the bank account database file.
Last name
First name
MI
Social security number
Phone number
Account Balance
Account Number
Account Password
BANK ACCOUNT DATABASE FILE
The DB file shall have the exact format exhibited below, with bank account records delimited by blank lines.
The following example bank account database file contains three records.
Richards
Steven
A
123-89-4321
(775)332-4581
76809.21
a123b
a23b42
Smith
Shelly
B
323-77-2134
(775)785-1291
126812.33
c123a
z52c42
Kim
Justin
M
782-23-5512
(702)132-1351
29122.35
f123c
u2xc90
PROGRAM OUTPUT: BANK ACCOUNT DATABASE REPORT FILE
When the user chooses to write a report, a report file shall be written.
The default report file name shall be: BankAcct.Rpt
The program shall give the user the choice of picking a different name for the report file.
If the user chooses to do so, the user shall be prompted to enter the alternate name of the report file.
The report file shall include the same information as the bank account database output file, but it shall be formatted for human viewing, as a table.
The #include file <iomanip> shall be used for this purpose.
BANK ACCOUNT DATABASE REPORT FILE
The following example bank account database report file contains the same three records, but is formatted and, therefore, easier for a human to read.
——- |
—- |
—– |
— |
———– |
————- |
——— |
Account |
Last |
First |
MI |
SS |
Phone |
Account |
Number |
Name |
Name |
Number |
Number |
Balance |
|
——- |
—- |
—– |
— |
———– |
————- |
——— |
a123b |
Richards |
Steven |
A |
123-89-4321 |
(775)332-4581 |
76809.21 |
c123a |
Smith |
Shelly |
B |
323-77-2134 |
(775)785-1291 |
126812.33 |
f123c |
Kim |
Justin |
M |
782-23-5512 |
(702)132-1351 |
29122.35 |
COMMAND-LINE MODE
-
bankacct /Odb_file /Aacct_num /Ppassword /Ddeposit_amt bankacct /Odb_file /Aacct_num /Ppassword /Wwithdraw_amt
Deposit or withdraw “amount” for account with provided “account number” and “account password.”
Examples: bankacct /OBankDB.txt /Aa123b /Pa23b42 /D12309.20 bankacct /OBankDB.txt /Aa123b /Pa23b42 /W55809.02
-
bankacct /Odb_file /Aacct_num /Ppassword /Aacct_num /Ppassword /Ttrans_amt
Transfer “amount” from the first “account number” and “account password” pair to the second “account number” and “account password” pair. Two different accounts must be used.
Example: bankacct /OBankDB.txt /Aa123b /Pa23b42 /Ac123a /Pz52c42 /T76809.20
Transfer from “account number” a123b with “password” a23b42 to “account number” c123a with “pass-word” z52c42 an amount of $76809.20. If insufficient funds, do not transfer anything.
-
bankacct /Odb_file /Aacct_num /Ppassword /Cnewpassword
Change “password” for account with provided “account number” and “account password.”
Equivalent examples:
bankacct /OBankDB.txt /Aa123b /Pa23b42 /CZZSTOP bankacct /Aa123b /Pa23b42 /CZZSTOP /OBankDB.txt
Change the password of “account number” a123b with “password” a23b42 to have the new password
ZZSTOP.
-
bankacct /Odb_file /Rrpt_file
Produce a “report” file of the bank account database, put the report in a file named “rpt_file.”
Equivalent examples:
bankacct /OBankDB.txt /RBankRpt.txt bankacct /RBankRpt.txt /OBankDB.txt
CODING CONVENTION
-
Each file shall have a file header.
-
Each function shall have a function header.
-
Your code shall be properly indented and commented.
GENERAL PROJECT REQUIREMENTS
Programs submitted as part of a project must have an executable built on the Linux server.
Programs submitted as part of a project must satisfy the requirements of the project.
The student must present the project to the class, discussing the project’s requirements and how the program sat-isfies them, giving sample runs for the program, walking through the source codes for the program, discussing the project’s makefile, discussing the program’s shortcomings and known bugs.
SUBMISSION REQUIREMENTS
Submit a “tgz” file named proj1.tgz that contains the entire project: executable, source files, makefile, and data files.
Make sure all your files are in your: Proj1 directory.
Use FileZilla to copy your “.tgz” file from the Linux server over to your Windows machine.
Upload the “tgz” file to Canvas.
Submission verification is possible because you are allowed to download files from Canvas.
You should test your submission by performing the following procedure:
-
Download your “tgz” file from the Canvas drop box.
-
Unzip your “tgz” file (extract its contents).
-
Transfer the file(s) to the server.
-
Be sure to do this in a different “test” directory, so you don’t overwrite previous work.
-
Run the resulting program.