Question
LAB2 PART 2 Provide the application name BankService_yourLastName for a bank that has the service with the checking accounts and saving accounts FOR THE DATA
LAB2 PART 2
Provide the application name BankService_yourLastName for a bank that has the service with the checking accounts and saving accounts
FOR THE DATA TYPE CLASS
-class Account_yourLastName: you can reuse the class Account of part 1
-class CheckingAccount_yourLastName that inherits from class Account and holds one more field: serviceFee (float)
-class SavingAccount_yourLastName that inherits from class Account and holds one more field: interestRate(float)
Class CheckingAccount_yourLastName and SavingAccount_yourLastName also handle the following actions. When you write the code for these actions, you should let it inherit the code from parent class do not repeat what you have in class Account_yourLastName
OPEN ACCOUNT
Minimum amount of Checking Account is $20, minimum amount of Saving Account is $50
-if money amount to open account is less than minimum amount then display the message:
Invalid open account amount
Otherwise display the message (if service fee read from the keyboard is $10.0)
Account Number: 1567794657
New account balance: 500.0
Account type: Checking Account
Service Fee: 10.0
OR
Account Number: 1567794657
New account balance: 500.0
Account type: Saving Account
Interest rate: 0.5%
CHECK BALANCE
Read and display the output as belows: (for example current balance is 500)
Account Number: 1567794657
Current Balance: 500.0
Account type: Checking Account
OR
Account Number: 1567794657
Current Balance: 500.0
Account type: Saving Account
DEPOSIT
-Accept the deposit amount that is read from the keyboard, calculate the new balnce then display output
(if deposit amount is 200)
Account type: Checking Account
Account Number: 1567794657
Current Balance: 500.0
Deposit amount: 200.0
New Balance: 700.0
OR
Account type: Saving Account
Account Number: 1567794657
Current Balance: 500.0
Deposit amount: 200.0
New Balance: 700.0
WITHDRAW
-Accept the withdraw amount that is read from the keyboard.
-Calculate the new balance.
-If withdraw amount causes the new balance less than the minimum amount, display the message Invalid withdraw amount and do not allow withdraw
Account type: Checking Account
Account Number: 1567794657
Current Balance: 700.0
Withdraw amount: 690.0 - denied
OR
Account type: Saving Account
Account Number: 1567794657
Current Balance: 700.0
Withdraw amount: 660.0 - denied
-Otherwise, display the output as belows: (for example withdraw amount is 300)
Account type: Checking Account
Account Number: 1567794657
Current Balance: 700.0
Withdraw amount: 300.0
New Balance: 400.0
OR
Account type: Saving Account
Account Number: 1567794657
Current Balance: 700.0
Withdraw amount: 300.0
New Balance: 400.0
PRINT MONTHLY STATEMENT
- if it is checking account , calculate the end balance with service fee (for example service fee is $10)
-dIsplay the following output:
Account type: Checking Account
Account Number: 1567794657
Current Balance: 400.0
Service Fee: 10.0
End balance: 390.0
OR
- if it is saving account, calculate the interest amount with interest rate (for example interest rate is 0.5%) and end balance
-display the following output:
Account type: Saving Account
Account Number: 1567794657
Current Balance 400.0
Interest rate: 0.5%
Interest amount: 2.0
End balance: 402.0
FOR THE DRIVER CLASS
Display the main menu:
BankServiceApplication_yourLastName.java
MAIN MENU LUIS MARTINEZ
- Open new account
- Check current balance
- Deposit
- Withdraw
- Print monthly statement
- Exit
Task 1: Open new account:
-Create an object of class Account_yourLastName, for example object named account
-display the sub menu to allow users select account type:
1. Checking Account
2. Saving Account
-Read account type the apply Polymorphism, using the object of class Account_yourLastName account to create new Checking account or new Saving account
- If it is checking account, ask for service fee then create the Checking Account
- If it is saving account, ask for interest rate then create the Saving Account
-Ask for the money amount down to open account.
-then display the output as by calling the method open account from class CheckingAccount_yourLastName or class SavingAccount_yourLastName
FROM TASK2 TO TASK5, IF THE ACCOUNT IS NOT OPEN YET, DISPLAY MESSAGE YOU HAVE TO OPEN ACCOUNT BEFORE SELECTING THIS TASK THEN CALL THE TASK 1 TO OPEN NEW ACCOUNT
Task 2: Check current balance
-use the current account to call method from the data type classs to display message about the current balance
Task 3: Deposit
-Ask how much users want to deposit then call the method deposit
Task 4: Withdraw
-Ask how much users want to withdraw then call the method withdraw
Task 5: Print monthly statement
-call the method print monthly statement
EXIT
When users exit display the message box:
Thank you. The application is terminating..
Remember:
-The file name should be the first comment line at the top of class
-write the comment on each parts of both classes
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started