Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

file attached

1 answer below »
9/13/22, 10:02 PM Assignment 2: Objects
https:
webcourses.ucf.edu/courses/1413634/assignments/ XXXXXXXXXX/7
Assignment 2: Objects
Due Friday by 11:59pm Points 100 Submitting a file upload File Types java
Available until Sep 23 at 11:59pm
Start Assignment
Knightro has decided to open is own bank. In this new bank, he decided he will at most have only 5
accounts at one time. He will do some pretty standard stuff with his accounts, such as depositing
money, withdrawing money, checking the balance, and calculating interest. Your task is to write a
program that handles the accounts.
Program Specifications
You will write two classes, Bank and Account. Please do this in two different files. I am asking you
not to be fancy.
Within the Bank Class do the following:
Create a private static a
ay of Account. The size of the a
ay will be 5.
Within the main method, create a menu that asks:
Displays the name of each account and the number.
Which account would you like to work on (Assign a value 1-5 to each account)
Exit Program
When they select the account, they can do the following:
If empty, it automatically creates an account.
To create an account, you need to ask the following information:
Account name
Interest rate (formatted as a double for example: 1.5)
If it is not empty ask the user if they would like to do the following:
Deposit Funds
Withdraw Funds
Check Balance
Calculate Interest
Delete Account
For each of these but delete will call a method in the Account class. You will need to ask
for the information here.
Delete account sets the index value to Null.
Deposit, and Withdraw will return true if the operation is successful and a false if you are
unable to complete it. Do not check to see the user entered valid options here, allow the
Account class to handle it.
9/13/22, 10:02 PM Assignment 2: Objects
https:
webcourses.ucf.edu/courses/1413634/assignments/ XXXXXXXXXX/7
In the Account class do the following:
Create an instance private variable for the account name, balance, and interest rate
Create a constructor that will take in a String for the account name, and a double for the interest
ate
Create the following public instance methods:
deposit - takes in a double that will represent the funds that should be deposited. If the
number is 0 or less, you cannot deposit this and return false, otherwise it will add this amount
to the balance and return true.
withdraw - takes in a double that will represent the funds that should be taken from the
alance. If the number is 0 or less or would make the balance less than 0 then you cannot
withdraw this amount of funds and return false. Otherwise, update the balance and return
true.
getBalance - returns the balance as a double
getName - returns the name of the account
calcInterest - takes in an integer that will have value from 1-1,000 that represents how many
months have passed. Calculate interest that should be added to the account. Example: If the
alance is $100, interest is 10% and the parameter's value is 6 (months), then the new
alance would be $105.00.
Math:
InterestPeriod = 10*(6/12)/100
newTotal = 100 * (1 + InterestPeriod)
Example
Welcome to Knightro Banking:
1. Empty
2. Empty
3. Empty
4. Empty
5. Empty
6. Exit Program
What would you like to do?
3
Creating a new account.
What is the name of the account:
Kyle
What is the interest rate?
10
1. Empty
2. Empty
3. Kyle
4. Empty
5. Empty
6. Exit Program
What would you like to do?
3
What would you like to do?
1. Deposit Funds
2. Withdraw Funds
9/13/22, 10:02 PM Assignment 2: Objects
https:
webcourses.ucf.edu/courses/1413634/assignments/ XXXXXXXXXX/7
3. Check Balance
4. Calculate Interest
5. Close Account
What would you like to do?
1
How much money would you like to deposit?
-5
This is an invalid amount
1. Empty
2. Empty
3. Kyle
4. Empty
5. Empty
6. Exit Program
What would you like to do?
3
What would you like to do?
1. Deposit Funds
2. Withdraw Funds
3. Check Balance
4. Calculate Interest
5. Close Account
What would you like to do?
1
How much money would you like to deposit?
100
You have added $100.00.
1. Empty
2. Empty
3. Kyle
4. Empty
5. Empty
6. Exit Program
What would you like to do?
3
What would you like to do?
1. Deposit Funds
2. Withdraw Funds
3. Check Balance
4. Calculate Interest
5. Close Account
What would you like to do?
3
You have $100.
1. Empty
2. Empty
3. Kyle
4. Empty
5. Empty
6. Exit Program
What would you like to do?
3
What would you like to do?
1. Deposit Funds
2. Withdraw Funds
3. Check Balance
4. Calculate Interest
5. Close Account
What would you like to do?
2
How much would you like to withdraw?
200
This is an invalid amount
1. Empty
2. Empty
3. Kyle
4. Empty
5. Empty
9/13/22, 10:02 PM Assignment 2: Objects
https:
webcourses.ucf.edu/courses/1413634/assignments/ XXXXXXXXXX/7
6. Exit Program
What would you like to do?
3
What would you like to do?
1. Deposit Funds
2. Withdraw Funds
3. Check Balance
4. Calculate Interest
5. Close Account
What would you like to do?
2
How much would you like to withdraw?
-100
This is an invalid amount
1. Empty
2. Empty
3. Kyle
4. Empty
5. Empty
6. Exit Program
What would you like to do?
3
What would you like to do?
1. Deposit Funds
2. Withdraw Funds
3. Check Balance
4. Calculate Interest
5. Close Account
What would you like to do?
2
How much would you like to withdraw?
90
You have withdrawn $90.
1. Empty
2. Empty
3. Kyle
4. Empty
5. Empty
6. Exit Program
What would you like to do?
3
What would you like to do?
1. Deposit Funds
2. Withdraw Funds
3. Check Balance
4. Calculate Interest
5. Close Account
What would you like to do?
4
How many months have past?
6
Done
1. Empty
2. Empty
3. Kyle
4. Empty
5. Empty
6. Exit Program
What would you like to do?
3
What would you like to do?
1. Deposit Funds
2. Withdraw Funds
3. Check Balance
4. Calculate Interest
5. Close Account
What would you like to do?
3
9/13/22, 10:02 PM Assignment 2: Objects
https:
webcourses.ucf.edu/courses/1413634/assignments/ XXXXXXXXXX/7
Some Ru
ic
You have $10.50
1. Empty
2. Empty
3. Kyle
4. Empty
5. Empty
6. Exit Program
What would you like to do?
3
What would you like to do?
1. Deposit Funds
2. Withdraw Funds
3. Check Balance
4. Calculate Interest
5. Close Account
What would you like to do?
5
Account closed.
1. Empty
2. Empty
3. Empty
4. Empty
5. Empty
6. Exit Program
What would you like to do?
6
Goodbye.

Other Notes:
9/13/22, 10:02 PM Assignment 2: Objects
https:
webcourses.ucf.edu/courses/1413634/assignments/ XXXXXXXXXX/7
Criteria Ratings Pts
10 pts
5 pts
5 pts
5 pts
5 pts
5 pts
5 pts
10 pts
General
Students submitted two files name Bank.java and
Account.java. Includes their name, course, assignment title,
and date. Program runs to completion, and is not apart of a
package.
10 pts
Complete
5 pts
Missing
Heade
Comment
0 pts
Does not
un/missing
files.
Requires
esubmission
Bank - Variables
Contains a private static a
ay of Account with size 5.
5 pts
Yes
0 pts
No
Bank - Menu
Prints out a list of accounts for each menu. If there is no value
within the a
ay print out the word "Empty"
5 pts
Yes
0 pts
No
Bank - Create New Account
Gathers the information needed for a new account, and
creates a new account (calls the constructor) and saves it into
the a
ay.
5 pts
Yes
0 pts
No
Bank - Account Options
Gathers the information needed for each option and calls the
method needed.
5 pts
Yes
0 pts
No
Bank - Success/E
ors
Prints out if the method was able to accomplish it's task and
prints the appropriate messages.
5 pts
Yes
0 pts
No
Bank - Deletes Account
Sets the index of the cu
ent account to null.
5 pts
Yes
0 pts
No
Account - Variables
Creates a private instance variables for account name,
alance, and interest.
10 pts
Yes
5 pts
Missing parts
If variables are not
private, or missing
a variable. If both
no credit.
0 pts
No
If
variables
are
static, no
credit.
9/13/22, 10:02 PM Assignment 2: Objects
https:
webcourses.ucf.edu/courses/1413634/assignments/ XXXXXXXXXX/7
Total Points: 100
Criteria Ratings Pts
10 pts
5 pts
5 pts
5 pts
5 pts
10 pts
10 pts
Account - Constructo
Creates a constructor that takes in two values and sets all
instance variables.
10 pts
Yes
0 pts
No
Account - Deposit
Takes in a double, and returns a boolean. Deposits the value if
a valid number is inputed. Returns true if it is successful o
false if not.
5 pts
Yes
0 pts
No
Account - Withdraw
Takes in a double, and returns a boolean. Withdraws the value
if a valid number is inputed. Returns true if it is successful o
false if not.
5 pts
Yes
0 pts
No
Account - Check Balance
No
Answered 2 days After Sep 14, 2022

Solution

Arun Shankar answered on Sep 16 2022
54 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here