Sunteți pe pagina 1din 3

Due: 01-Nov-2016

50 points

CS 108

Programming Assignment 5

Objectives
1) Students will design an application that utilizes inheritance and polymorphism.
2) Students will sketch the application class relationships, including all interfaces and abstract
classes.
3) Students will use development best practices.

Background Reading

ZyBooks: 9- Objects and Classes, 10- Inheritance, 11- Abstract Classes and Interfaces

Assignment
Write an application that creates one Bank with three different bank account types: SavingsAccount,
CheckingAccount, and IRAAccount. The Bank class implements the Transaction interface. The accounts
extend the abstract Account class.

Part 1: Relationship Diagram Due Thursday, October 27, 2016 2 p.m.


Sketch the relationship diagram. Identify any has-a, is-a, and can-do relationships. Include the name of
the class or interface, any class variables and methods.

Part 2: Java files Due Tuesday, November 1, 2016 2 p.m


Implement the classes based on the documentation files. These are provided with the assignment in a
compressed file (.zip) called Lab5Doc.zip.
To test your code, run BankDriver application.

Driver output:
Program 5, Patty Kraft, masc0777
Creating accounts...
Customer: Waterford Ellingsworth, Savings account 1 Balance: $4350.00
Customer: Bethanie Treadwell, Checking account 2 Balance: $500.00
Customer: Ira Standish, IRA Savings account 3 Balance: $50000.00, Disbursement Age=59, Early Withdrawal Penalty=0.1
Performing transactions...
Savings account 1 Balance: $4550.00
Checking account 2 Balance: $286.87
IRA Savings account 3 Balance: $50000.00, Disbursement Age=59, Early Withdrawal Penalty=0.1
Updating accounts...
Savings account 1 Balance: $4559.10
Checking account 2 Balance: $286.52
IRA Savings account 3 Balance: $55000.00, Disbursement Age=59, Early Withdrawal Penalty=0.1

Extra Credit
Create a DebitCard account that extends CheckingAccount. Add public methods debit() and credit(); set
transaction fee to 0.35. Be efficient! Reuse code.
Output:
Customer: Debi Cardashian, Debit Card Checking account 4 Balance: $5100.00
Debit Card Checking account 4 Balance: $5100.00

On the due date


For full credit, the Java files should meet all requirements and be put into your ~/handin/Prog5/ directory
by the due date and identical copies of your Java files should be turned in at the start of class on the due
date. Papers should be stapled together with the grading rubric on top. Your name should be clearly
visible on the rubric.
Files (7) to be in the ~/handin/Prog5/ directory are:
Bank.java
Account.java
Transaction.java
SavingsAccount.java
CheckingAccount.java
IRAAccount.java
BankDriver.java // Add your identification line to this file only
DebitCard.java // OPTIONAL for extra credit.

Late Policy
Programs will be accepted up to 1 class period late with a 10% penalty. Grading will be delayed.

Name_______________________________
MascID: masc___________

Grading Rubric Program 5


Criteria

Proficient

Competent

Novice

Unsatisfactory

Delivery

All files delivered on time


to edoras:/handin and
exact copies submitted in
class along with
relationship diagram.
Rubric attached.

Most files delivered on


time to edoras:/handin,
or exact copies not
submitted in class
along with relationship
diagram.

Few files delivered on


time to edoras:/handin
or exact copies not
submitted in class
along with relationship
diagram.

No requirements
me, or program was
more than one class
period late.
Rubric not attached.

Identification
5

The identification line


displays in BankDriver
and contains program
assignment, full name,
and mascID.

The identification
line is not present.

Documentation &
Readability
9

The documentation is
well written and clearly
explains what the code is
accomplishing and how.
The code is exceptionally
well organized and very
easy to follow and
conforms to best
practices.

The documentation
consists of embedded
comment and some
simple header
documentation that is
somewhat useful in
understanding the
code. The code is fairly
easy to read and
conforms to most best
practices.

The documentation is
simply comments
embedded in the code
with some simple
header comments
separating routines.
The code is readable
only to grader who has
the assignment
description.

The documentation
is simply comments
embedded in the
code and does not
help the reader
understand the
code.
The code is quite
difficult to read and
poorly organized.

Relationship
Diagram
6

All entities accounted for


and in correct
relationships.

All entities accounted


for but some incorrect
relationship(s).

Entity(ies)
unaccounted for and/or
incorrect
relationship(s).

Omitted or illconceived diagram.

All classes corrected


implemented. Driver
works correctly.

Some errors in
implementation or
application output.

Several errors in
implementation and/or
application output.

Application does not


compile and/or very
flawed
implementation
and/or application
output.

Correctness and
Test cases
30

S-ar putea să vă placă și