You are expected to exercise good programming style and


Assignment Policy

The focus of the homework assignments is to provide you with an opportunity to apply the software
development concepts, tools, design guidelines, and techniques described in the text and presented in class.

Your performance on the assignments also serves as an indicator of how well you understand the material.

You are encouraged to study in groups; however, you should make every effort to hand in work that represents your own efforts.

Please keep in mind that software development starts with a clear understanding of what and how the software is to perform.

Thus, it is your responsibility to make sure you have a clear understanding of what is expected.

Once you have a clear understanding of what and how the software should perform, you should develop and test the "logic" or the algorithm.

If you develop and test the algorithm first, then writing the code becomes merely a task of translation!

For each assignment, you must submit a compressed (zip) file of the project's folder, which includes its subfolders and source code file(s), via the Blackboard.

Please note:

a. You are expected to exercise good programming style and practices (i.e., follow the design guidelines, use meaningful variable names, indentation, blank lines and blank spaces to improve readability, and comments).

b. When you create a project for an assignment, you should name it in the following manner:
your netid followed by the assignment's number.

For example: if your email address is
[email protected], the project names should be AbcHwk1 for assignment #1, AbcHwk2 for assignment #2, etc.

Assignment Grading Criteria

Each assignment is worth a total of 100 points. The grading criteria and point values are described below.

A SOURCE CODE

1. Programmer named variables and functions that are meaningless or confusing (to the grader).

Deduct maximum 9 points.

2. Did not use an appropriate data type for each variable (i.e., use String instead of integer data type for a whole number).

Deduct maximum 10 points.

3. Insufficient use of blank lines, blank spaces, or indentation.

Deduct maximum 8 points.

4. Insufficient use of comments.

Deduct maximum 8 points.

B PROGRAM EXECUTION

1. Source code file does not compile successfully because of syntax errors and thus cannot be executed.

Deduct maximum 65 points.

2. Source code file compiles successfully, but the program, when executed, does not perform as specified.

Deduct maximum 65 points.

You receive partial credits for the correct parts.

Due Date:

submit a compressed (zip) file of the assignment's project folder, which includes its project's subfolder and source code files, via the Blackboard by 11:59pm on Friday, May 1, 2015.

There will be a penalty of 15 points per day for turning in the assignment after the due date.

I will not accept your submission after (due date + 2).

Problem Statement

For this assignment, you need to create five classes: Transaction, Account, Savings, Checking, and TestAccount.

Note that the Account class is an abstract class (see Chapter 13).

It has several concrete methods and one abstract method printMonthlyReport().

The UML class diagram for the first four classes is shown on the last page.

The TestAccount class is the main class that uses the first four classes. In the TestAccount class, you are required to write an application (program) that simulates a simple ATM system.

There are two types of accounts:

a. Savings account. Minimum monthly balance of at least $1,000 required, pays interest on the ending monthly balance at an annual rate of 3% and charges NO fees unless the ending monthly balance drops below $1,000, which results in a $25 penalty (which is deducted before the interest
earned is calculated).

b. Checking account. No minimum monthly balance required, pays NO interest and charges a monthly fee of $3.00.

There is a usage fee of $1.00 for every usage of the ATM system.

Thus, for every deposit, withdraw, or transfer transaction, a fee of $1.00 is applied to the appropriate account.

In case of a transfer transaction, the $1.00 usage fee is applied to the source account and no fee is applied to the destination account.
For simplicity, assume that Mr. John Doe has an initial balance of $1,000.00 and $500.00 in his Savings and Checking accounts, respectively.

Also, assume that the customer has signed onto the ATM machine and has provided a password that the system validated. After creating the Savings and Checking accounts for Mr. John Doe, the program should begin with a Main menu, which asks the user to select the type of transaction to process: D to make a deposit, W to withdraw, T to transfer money from one account to another, and Q to quit from the system.


If the customer selects D (deposit) or W (withdraw), on the next screen, the program should display an Account menu that lists the available accounts: S for savings account and C for checking account.

When the customer selects S (savings) or C (checking), the program then should ask the customer to enter the amount of transaction (deposit or withdraw amount).

If the amount is negative, the program should display an appropriate error message to the customer and let him/her reenter the amount.

Deposit amounts should be added to the appropriate account (Savings or Checking) balance while withdrawal amounts should be deducted from the appropriate account balance.

Note that if the withdrawal amount is greater than the current balance, an insufficient funds message should be displayed to the customer, the withdrawal transaction should be canceled, and let the customer reenter the amount to withdraw.

If the customer selects T (transfer), on the next screen, the program should display an Account menu that lists the available source accounts to transfer from: S for savings account and C for checking account.

After the customer selects S (savings) or C (checking), on the next screen, the program should display an Account menu again that lists the available destination accounts to transfer to: S for savings account and C for checking account.

If the destination account is the same as the source account, your program should display an appropriate error message and then redisplay the Account menu that lists the available source accounts to transfer from.

Otherwise, the program then should ask the customer to enter the amount to transfer.

If the amount is negative or is greater than the available balance in the source account, the program should display an appropriate message and let the customer reenter the amount to transfer again.

If there are enough funds to transfer, this amount should be deducted from the source account and then the same amount is added to the destination account.

The program should keep track each transaction for each account.
If the user selects Quit, the program should display the monthly reports for both saving and checking accounts. When the user presses the ENTER key, the program terminates. Assume that when the user selects Quit, one month has elapsed since the beginning of the transactions.

Additional Specifications

1. If the user selects an "invalid" menu selection, display an appropriate error message, pause
program execution until the user presses the ENTER key, and then redisplay the menu selection.

2. Allow the user to enter either upper- or lower-case letters for making menu selection.

3. There are an unknown number of transactions (deposits, withdrawals, and transfers) and their "order/sequence of occurrence" is also unknown.

The program should return the user to the main menu after each transaction (deposit, withdrawal, and transfer) or after each canceled transaction.

Sample run of the ATM machine is as follows:

Main menu
D: deposit
W: withdraw
T: transfer
Q: quit
Enter D, W, or T to start a transaction or Q to quit: d

Account menu
C: Checking account
S: Savings account
Select an account for a deposit transaction: c
Enter the amount to deposit: 80
$80.00 was successfully added to your Checking account.
Hit the Enter key to return to the Main menu:

Main menu
D: deposit
W: withdraw
T: transfer
Q: quit
Enter D, W, or T to start a transaction or Q to quit: w

Account menu
C: Checking account
S: Savings account
Select an account for a withdrawal transaction: c
Enter the amount to withdraw: 20
$20.00 was successfully withdrawn from your Checking account.
Hit the Enter key to return to the Main menu:

Main menu
D: deposit
W: withdraw
T: transfer
Q: quit
Enter D, W, or T to start a transaction or Q to quit: t

Account menu
C: Checking account
S: Savings account
Select the source account to transfer from: c

Account menu
C: Checking account
S: Savings account
Select the destination account to transfer to: s
Enter the amount to transfer: 60
$60.00 was successfully transferred from Checking account to Savings account.
Hit the Enter key to return to the Main menu:

Main menu
D: deposit
W: withdraw
T: transfer
Q: quit
Enter D, W, or T to start a transaction or Q to quit: d

Account menu
C: Checking account
S: Savings account
Select an account for a deposit transaction: s
Enter the amount to deposit: 40
$40.00 was successfully added to your Savings account.
Hit the Enter key to return to the Main menu:

Main menu
D: deposit
W: withdraw
T: transfer
Q: quit
Enter D, W, or T to start a transaction or Q to quit: w

Account menu
C: Checking account
S: Savings account
Select an account for a withdrawal transaction: s
Enter the amount to withdraw: 20
$20.00 was successfully withdrawn from your Savings account.
Hit the Enter key to return to the Main menu:

Main menu
D: deposit
W: withdraw
T: transfer
Q: quit
Enter D, W, or T to start a transaction or Q to quit: t

Account menu
C: Checking account
S: Savings account
Select the source account to transfer from: s

Account menu
C: Checking account
S: Savings account
Select the destination account to transfer to: c
Enter the amount to transfer: 80
$80.00 was successfully transferred from Savings account to Checking account.
Hit the Enter key to return to the Main menu:

Main menu
D: deposit
W: withdraw
T: transfer
Q: quit
Enter D, W, or T to start a transaction or Q to quit: q
Checking Account Monthly Statement
Account Owner: John Doe
Monthly fee: $3.00
Balance after monthly fee: $534.00

Transactions:
Date Type Amount Fee Balance Comments
4/13/2015 D $80.00 $1.00 $579.00
4/13/2015 W $20.00 $1.00 $558.00
4/13/2015 T $60.00 $1.00 $497.00 Transfer out to Savings
4/13/2015 T $40.00 $0.00 $537.00 Transfer in from Savings
Savings Account Monthly Statement
Account Owner: John Doe
Annual interest rate: 3.00%
Penalty: $25.00
Balance after penalty: $972.00
Interest earned: $2.43
Balance after interest: $974.43

Transactions:
Date Type Amount Fee Balance Comments
4/13/2015 T $60.00 $0.00 $1,060.00 Transfer in from Checking
4/13/2015 D $40.00 $1.00 $1,099.00
4/13/2015 W $20.00 $1.00 $1,078.00
4/13/2015 T $80.00 $1.00 $997.00 Transfer out to Checking
A possible class diagram for Transaction, Account, Savings, and Checking, is as follows:

Transaction
-date: Date
-type: char
-amount: double
-fee: double
-balance: double
-comments: String
+Transaction(type: char, amount: double, fee: double, balance: double, comments: String)
+getDate(): Date
+getType(): char
+getAmount(): double
+getFee(): double
+getBalance(): double
+getComments(): String
+setType(type: char): void
+setAmount(amount: double): void
+setFee(fee: double): void
+setBalance(balance: double): void
+setComments(comments: String): void
0..m
1

Account
-id: int
-type: String
-name: String
-balance: double
-usageFee: double
-transactions: ArrayList

#Account(id: int, name: String, balance: double, type: String)
+getId(): int
+getType(): String
+setName(name: String): void
+getName(): String
+getBalance(): double
+setUsageFee(usageFee: double): void
+getUsageFee(): double
+deposit(amount: double): void
+withdraw(amount: double): void
+transferIn(amount: double): void
+transferOut(amount: double): void
+printMonthlyReport(): void

Savings
-minimumBalance: double
-annualRate: double
-penalty: double
+Savings(id: int, name: String, balance: double)
+setMinimumBalance(amount: double): void
+getMinimumBalance(): double
+setAnnualRate(rate: double): void
+getAnnualRate(): double
+setPenalty(penalty: double): void
+getPenalty(): double
+getMonthlyInterest(): double
+printMonthlyReport(): void

Checking
-monthlyFee: double
+Checking(id: int, name: String, balance: double)
+setMonthlyFee(fee: double): void
+getMonthlyFee(): double
+printMonthlyReport(): void

 

Solution Preview :

Prepared by a verified Expert
Programming Languages: You are expected to exercise good programming style and
Reference No:- TGS01224333

Now Priced at $40 (50% Discount)

Recommended (91%)

Rated (4.3/5)

A

Anonymous user

2/18/2016 2:46:55 AM

As shown assignment Policy: The focus of the homework assignments is to give you through an opportunity to relate the software development ideas, tools, design guidelines, and techniques explained in the text and presented in class. Your performance on the assignments as well serves as an indicator of how well you understand the substance. You are encouraged to learn in groups; though, you should create every effort to hand in work that symbolizes your own efforts. Please keep in mind that software development starts through a clear understanding of what and how the software is to perform. Therefore, it is your responsibility to make sure you have a clear understanding of what is expected.