Monday 26 May 2014

Coding: Assignment #3

The third assignment has to do with reverse engineering and code enhancement.  You have to take an existing program, understand it and add enhancements to it.  Third Assignment Due May 26rd.

I have given you a banking program that takes only 2 customers and allows each user to have passwords that are 4 characters long.    Extend it to do the following.


1.  Change the code so that the bank can have 10 customers.
2.  The password is 6 characters long and has at least one of the following (capital letters, small letters, numbers and special characters which are ~!@#$%\^&*()\-_=+\|\[{\]};:'",<.>/?
3.  Add a short comments to each logical code block.  e.g if statement  
4.  Comment each of the try-catch blocks.
5.  Change the programme to be Bank + your initials.  eg. mine would be BankEB.java
5.  Write the list of requirements of the program.  
   a) This bank has X numbers, 
   b) Each customer has Y accounts, 
   c) The bank gives each customer z dollars when they open an account etc..
   d) Passwords have to be h length and must contain a, b, c,

=============
Evaluation:
Good introductory comment at the top of the program.
Good comments for each block.

One problem:

1) A weak 5 character password is rejected but a weak 6 character password is accepted.  See yellow the highlighted text below.

9 out of 10.

=============

Would you like to do some banking? (y)es or (n)o?
y
 Who are you? 
eb
 Could not find you in our database. We are currently opening some new accounts for you. 
 Guess what! We opened 2 new accounts for you with $100 in each!
 Now you need to create a PIN. It must be of a length of 6 characters.  Please enter a PIN now

qwert
 You need 6 characters.
Invalid response.  Deleting accounts.  Goodbye
Would you like to do some banking? (y)es or (n)o?
y
 Who are you? 
ew
 Could not find you in our database. We are currently opening some new accounts for you. 
 Guess what! We opened 2 new accounts for you with $100 in each!
 Now you need to create a PIN. It must be of a length of 6 characters.  Please enter a PIN now

qwerty
You should include capitals.
Welcome to BankDJ.ew

Would you like to (1) deposit, (2) withdraw, (3) transfer, (4) check balances, (5) finish
5
Would you like to do some banking? (y)es or (n)o?
y
 Who are you? 
ea
 Could not find you in our database. We are currently opening some new accounts for you. 
 Guess what! We opened 2 new accounts for you with $100 in each!
 Now you need to create a PIN. It must be of a length of 6 characters.  Please enter a PIN now

Q!1wer
Accepted. A very strong PIN
Welcome to BankDJ.ea

Would you like to (1) deposit, (2) withdraw, (3) transfer, (4) check balances, (5) finish

No comments:

Post a Comment