首页 > > 详细

INFO1113 Assignment 1

 INFO1113 Assignment 1

This assignment is worth 6% of your final assessment
Task Description
In this assignment you will develop a banking administrative system called BankerOS in the Java programming 
language. All bank accounts within the system will contain various details relating to the owner of the 
account. Each account is identified by a unique account number and maintains a history of transactions 
received and sent.
You are encouraged to ask questions on Ed using the assignments category. As with any assignment, make 
sure that your work is your own, and you do not share your code or solutions with other students.
Working on your assignment
You can work on this assignment on your own computer or the lab machines. It is important that you 
continually back up your assignment files onto your own machine, external drives, and in the cloud.
You are encouraged to submit your assignment on Ed while you are in the process of completing it. By 
submitting you will obtain some feedback of your progress on the sample test cases provided.
INFO1113
Page 2 of 11
Implementation details
Write a program in Java that implements the BankerOS application as shown in the examples below. You can 
assume that our test cases will contain only valid input commands and not cause any integer overflows. 
Commands are case insensitive.
BankerOS stores a collection of Bank Accounts and the Transactions associated with them. Bank Accounts
are identified by their account number (ACCNO), and store first name, last name, transaction history and 
current balance. By default, accounts begin with $10,000, however this can be overridden (see commands).
Balances are stored as integers to remove decimal errors. Account numbers begin from 100,000 and are 
incremental (first account is 100000, second is 100001).
Transactions store sender, receiver, amount and hash. They are indexed from 1 and have unique indices.
Both the sender and receiver must have bank accounts within the system to be a valid transaction. The hash
is generated based on the details of the transaction as well as the hash of the previous transaction to ensure 
that ledgers are not modified.
Ledgers (collections of transactions) can be archived in a human-readable text file, stored in chronological
order in the following form
, , , ,
Example
1, 100000, 100001, 10, 1128448214
When ledgers are archived, a second human-readable file is also created, storing the account numbers and 
names of all accounts. This is archived in the following form (in numerical order)
Example
100000, John, Smith, 10000
Archived ledgers can be restored by Banker, resetting the data to the ledger's archived state.
An account’s balance cannot go below $0. Transactions are aborted if they result in a negative balance. 
Your program can be contained within the scaffold of Banker.java, BankAccount.java and Transaction.java. 
Do not modify any of the existing method signatures in these files. Your program must produce no errors 
when built and run on the lab machines and Ed. Your program will read from standard input and write to 
standard output.
Your program output must match the exact output format shown in the examples and on Ed. You are 
encouraged to submit your assignment while you are working on it, so you can obtain some feedback. You 
have been provided simple skeleton classes and hints on how to implement your banking application.
In order to obtain full marks, your program will be checked against automatic test cases, manually inspected 
by your tutors and you must submit a set of test cases that ensure you have implemented functionality 
correctly.
INFO1113
Page 3 of 11
Commands
Your program should implement the following commands, look at the examples to see how they work.
• If an does not exist in the system, output: no such account
• If a does not exist in the system, output: no such transaction
EXIT exit from application
COMMANDS display the command list
LIST ACCOUNTS displays all accounts in system
LIST TRANSACTIONS displays all transactions in system
DETAILS displays all details about bank account
BALANCE displays the current balance of bank account
HISTORY displays all transactions involving an account
OUTGOING displays all transactions paid by account
INCOMING displays all transactions received by account
CREATE [] creates a bank account
RENAME renames a bank account
PAY transfers money between account
TRANSACTION displays the transaction details
CANCEL makes a copy of the transaction with receiver/sender swapped
ARCHIVE stores the transaction history as a ledger
RECOVER restores a ledger
MERGE transfers all funds from listed accounts into the first account
MAX displays the highest balance from all accounts
MIN displays the lowest balance from all accounts
MEAN displays the average balance
MEDIAN displays the median balance
TOTAL displays the amount of money stored by bank 
INFO1113
Page 4 of 11
Examples (1)
$ LIST ACCOUNTS
no accounts
$ LIST TRANSACTIONS
no transactions
$ DETAILS 100000
no such account
$ BALANCE 100000
no such account
$ HISTORY 100000
no such account
$ OUTGOING 100000
no such account
$ INCOMING 100000
no such account
$ RENAME 100000 John Smith
no such account
$ TRANSACTION 1
no such transaction
$ EXIT
bye
INFO1113
Page 5 of 11
Examples (2)
$ CREATE John Smith
success
$ CREATE Mary Jane 15000
success
$ LIST ACCOUNTS
100000
100001
$ DETAILS 100001
100001 – Mary Jane - $15000
$ BALANCE 100000
$10000
$ RENAME 100001 Mary Smith
success
$ PAY 100000 100001 10
success
$ PAY 100000 100001 10000
insufficient funds
$ PAY 100000 100000 10000
sender cannot be receiver
$ PAY 100000 100001 -1
amount must be positive
$ TRANSACTION 1
1: 100000 -> 100001 | $10 | 1128448214
$ EXIT
bye
INFO1113
Page 6 of 11
Examples (3)
$ CREATE John Smith
success
$ CREATE Mary Jane 15000
success
$ PAY 100000 100001 10
success
$ PAY 100000 100001 20
success
$ PAY 100001 100000 30
success
$ LIST TRANSACTIONS
1: 100000 -> 100001 | $10 | 1128448214
2: 100000 -> 100001 | $20 | 919049074
3: 100001 -> 100000 | $30 | 755697066
$ HISTORY 100000
1: 100000 -> 100001 | $10 | 1128448214
2: 100000 -> 100001 | $20 | 919049074
3: 100001 -> 100000 | $30 | 755697066
$ OUTGOING 100000
1: 100000 -> 100001 | $10 | 1128448214
2: 100000 -> 100001 | $20 | 919049074
$ INCOMING 100000
3: 100001 -> 100000 | $30 | 755697066
$ CANCEL 1
success
$ LIST TRANSACTIONS
1: 100000 -> 100001 | $10 | 1128448214
2: 100000 -> 100001 | $20 | 919049074
3: 100001 -> 100000 | $30 | 755697066
4: 100001 -> 100000 | $10 | -1389840415
$ EXIT
bye
INFO1113
Page 7 of 11
Examples (4)
$ CREATE John Smith
success
$ CREATE Mary Jane 15000
success
$ PAY 100000 100001 10
success
$ PAY 100000 100001 20
success
$ PAY 100001 100000 30
success
$ LIST TRANSACTIONS
1: 100000 -> 100001 | $10 | 1128448214
2: 100000 -> 100001 | $20 | 919049074
3: 100001 -> 100000 | $30 | 755697066
$ ARCHIVE ledger.txt accounts.txt
success
$ PAY 100001 100000 50
success
$ CREATE Andrew Perry
success
$ RECOVER ledger.txt accounts.txt
success
$ LIST TRANSACTIONS
1: 100000 -> 100001 | $10 | 1128448214
2: 100000 -> 100001 | $20 | 919049074
3: 100001 -> 100000 | $30 | 755697066
$ LIST ACCOUNTS
100000
100001
$ EXIT
bye
INFO1113
Page 8 of 11
Examples (5)
$ RECOVER bad_hash.txt accounts.txt
invalid ledger
$ CREATE John Smith
success
$ CREATE Amy Adams 0
success
$ PAY 100000 100001 10000
success
$ PAY 100001 100000 10
success
$ CANCEL 1
insufficient funds
$ RECOVER bad_ledger.txt accounts.txt
no such file
$ EXIT
bye
INFO1113
Page 9 of 11
Examples (6)
$ CREATE John Smith
success
$ CREATE Mary Jane 15000
success
$ CREATE Andrew Perry
success
$ PAY 100000 100001 30
success
$ MAX
$15030
$ MIN
$9970
$ MEAN
$11666
$ MEDIAN
$10000
$ TOTAL
$35000
$ MERGE 100000 100001 100002
success
$ LIST ACCOUNTS
100000
100001
100002
$ BALANCE 100000
$35000
$ EXIT
bye
INFO1113
Page 10 of 11
Writing your own testcases
We have provided you with some test cases but these do not test all the functionality described in the 
assignment. It is important that you thoroughly test your code by writing your own test cases.
You should place all of your test cases in the tests/ directory. Ensure that each test case has the .in input file 
along with a corresponding .out output file. We require that the names of your test cases are descriptive so 
that you know what each is testing, e.g. history.in & history.out and we can accurately and quickly assess 
your test cases. Note: If you do not format your test case files as explained (where each test case has 
.in and .out files for input and output), you shall receive 0 for this component.
Submission Details
Final deliverable for the correctness and manual inspection will be due on the 10th of April at midnight.
You must submit your code and tests using the assignment page on Ed. To submit, simply place your files and 
folders into the workspace, click run to check your program works and then click submit.
You are encouraged to submit multiple times, but only your last submission will be considered.
Marking
You will only be given valid inputs as part of the automatic test suite. Your program will be checked for errors 
that a user can possibly make. In addition, we will mark your program against a substantial collection of 
hidden test cases.
3 marks are assigned based on automatic tests for the correctness of your program. This component will use 
hidden test cases that cover every aspect of the specification. Your program must match the exact output in 
the examples and the test cases on Ed. 
3 marks are assigned based on a manual inspection of the style (1 mark) and tests cases (2 marks). Make sure 
that you carefully follow the assignment specifications and thoroughly test your code, optimising for 
coverage and testing for a variety of input ranges. Style will be assessed based on the conventions set out in 
the Google Java Style Guide (https://google.github.io/styleguide/javaguide.html)
INFO1113
11 of 11
Academic declaration
By submitting this assignment you declare the following:
I declare that I have read and understood the University of Sydney Student Plagiarism: Coursework Policy and Procedure, and except where specifically 
acknowledged, the work contained in this assignment/project is my own work, and has not been copied from other sources or been previously 
submitted for award or assessment.
I understand that failure to comply with the Student Plagiarism: Coursework Policy and Procedure can lead to severe penalties as outlined under 
Chapter 8 of the University of Sydney By-Law 1999 (as amended). These penalties may be imposed in cases where any significant portion of my 
submitted work has been copied without proper acknowledgment from other sources, including published works, the Internet, existing programs, the 
work of other students, or work previously submitted for other awards or assessments.
I realise that I may be asked to identify those portions of the work contributed by me and required to demonstrate my knowledge of the relevant 
material by answering oral questions or by undertaking supplementary work, either written or in the laboratory, in order to arrive at the final 
assessment mark.
I acknowledge that the School of Computer Science, in assessing this assignment, may reproduce it entirely, may provide a copy to another member 
of faculty, and/or communicate a copy of this assignment to a plagiarism checking service or in-house computer program, and that a copy of the 
assignment may be maintained by the service or the School of Computer Science for the purpose of future plagiarism checking.
联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!