CMSC 206 (Data Structures)
Assignment#1
Part A Due: January 26,
2012 11:59:59pm
Part B
Due: February 7, 2012 11:59:59pm
Part B Due: February
14, 2012 11:59:59pm
The goal of this assignment is
to develop your ability to do object-oriented programming,
focusing specifically on inheritance.
You must work with one partner
on this assignment.
To begin, download these two
files: Assignment1Skeleton.java
and CS206Assignment1.jar.
The
first (java) file is skeleton version of the program; start
with this file and fill in the parts marked as "FIXME" to
complete the assignment. The second (jar) file is a
completed version of the assignment that you can study.
To run this completed program, use the command java
-jar CS206Assignment1.jar
You will write a program that allows a user to repeatedly create new credit accounts from three possible types: a standard account, a gold account, or a last-chance account.
Welcome to CS206 Credit Company
MAIN MENU
1.) Create a new account
2.) Log into an existing account
3.) Exit the banking system
Please enter your selection: 1
CHOOSE THE TYPE FOR THE NEW ACCOUNT
1.) Standard credit account
2.) Gold credit account
3.) Last-chance credit account
Please enter your selection: 1
Created new standard credit account #0 with a credit limit
of $4000.0
STANDARD CREDIT ACCOUNT #0 MENU
1.) Get a balance on your account
2.) Charge your account
3.) Make a payment
4.) Log out
Please enter your selection: 2
TODO: CHARGE THE CREDIT ACCOUNT
STANDARD CREDIT ACCOUNT #0 MENU
1.) Get a balance on your account
2.) Charge your account
3.) Make a payment
4.) Log out
Please enter your selection: 3
TODO: MAKE A PAYMENT TO THE ACCOUNT
STANDARD CREDIT ACCOUNT #0 MENU
1.) Get a balance on your account
2.) Charge your account
3.) Make a payment
4.) Log out
Please enter your selection: 1
TODO: PRINT THE BALANCE ON THE ACCOUNT
STANDARD CREDIT ACCOUNT #0 MENU
1.) Get a balance on your account
2.) Charge your account
3.) Make a payment
4.) Log out
Please enter your selection: 4
Goodbye!
Welcome to CS206 Credit
Company
MAIN MENU
1.) Create a new account
2.) Log into an existing account
3.) Exit the banking system
Please enter your selection: 1
CHOOSE THE TYPE FOR THE NEW ACCOUNT
1.) Standard credit account
2.) Gold credit account
3.) Last-chance credit account
Please enter your selection: 1
Created new standard credit account #0 with a credit limit
of $4000.0
STANDARD CREDIT ACCOUNT #0 MENU
1.) Get a balance on your account
2.) Charge your account
3.) Make a payment
4.) Log out
Please enter your selection: 2
Enter charge amount: 1000
Charged $1000.0 New
balance $1000.0
STANDARD CREDIT ACCOUNT #0 MENU
1.) Get a balance on your account
2.) Charge your account
3.) Make a payment
4.) Log out
Please enter your selection: 3
Enter payment amount: 100
Charged interest $12.5
Received payment $100.0
New balance $912.5
STANDARD CREDIT ACCOUNT #0 MENU
1.) Get a balance on your account
2.) Charge your account
3.) Make a payment
4.) Log out
Please enter your selection: 4
Goodbye!
MAIN MENU
1.) Create a new account
2.) Log into an existing account
3.) Exit the banking system
Please enter your selection: 1
CHOOSE THE TYPE FOR THE NEW ACCOUNT
1.) Standard credit account
2.) Gold credit account
3.) Last-chance credit account
Please enter your selection: 2
Created new gold credit account #1 with a credit limit of
$100000.0
GOLD CREDIT ACCOUNT #1 MENU
1.) Get a balance on your account
2.) Charge your account
3.) Make a payment
4.) Log out
Please enter your selection: 2
Enter charge amount: 1000
Received cashback reward of $20.0
Charged $1000.0 New
balance $980.0
GOLD CREDIT ACCOUNT #1 MENU
1.) Get a balance on your account
2.) Charge your account
3.) Make a payment
4.) Log out
Please enter your selection: 4
Goodbye!
MAIN MENU
1.) Create a new account
2.) Log into an existing account
3.) Exit the banking system
Please enter your selection: 1
CHOOSE THE TYPE FOR THE NEW ACCOUNT
1.) Standard credit account
2.) Gold credit account
3.) Last-chance credit account
Please enter your selection: 3
Created new last-chance credit account #2 with a credit
limit of $1000.0
LAST-CHANCE CREDIT ACCOUNT #2 MENU
1.) Get a balance on your account
2.) Charge your account
3.) Make a payment
4.) Log out
Please enter your selection: 2
Enter charge amount: 1000
Charged $1000.0 New
balance $1000.0
LAST-CHANCE CREDIT ACCOUNT #2 MENU
1.) Get a balance on your account
2.) Charge your account
3.) Make a payment
4.) Log out
Please enter your selection: 3
Enter payment amount: 0
Charged interest $20.83
Missed payment. Increasing interest rate to 27%.
Received payment $0.0
New balance $1020.83
LAST-CHANCE CREDIT ACCOUNT #2 MENU
1.) Get a balance on your account
2.) Charge your account
3.) Make a payment
4.) Log out
Please enter your selection: 4
Goodbye!
MAIN MENU
1.) Create a new account
2.) Log into an existing account
3.) Exit the banking system
Please enter your selection: 3
Exiting Banking System