Question: ********* ONLY NEED PART 2 LAB2 PART 1 FOR THE DATA TYPE CLASS: Class Account_yourLastName holds the information of an account with account number (String),

********* ONLY NEED PART 2

LAB2 PART 1 FOR THE DATA TYPE CLASS: Class Account_yourLastName holds the information of an account with account number (String), balance (double) with no-argument constructor, parameter constructor. Also, define some methods to handle the tasks: open account, read current balance, deposit, withdraw, and print monthly statement and provide the following output for each method:

OPEN ACCOUNT For example with account number is 1567794657, and balance is 500 display the output as below:

Account Number: 1567794657 New Account balance: 500.0

CHECK BALANCE Read and display the output as belows: (for example current balance is 500)

Account Number: 1567794657 Current balance: 500.0

DEPOSIT -Accept the deposit amount, then calculate the new balance then display output (if deposit amount is 200)

Account Number: 1567794657 Current balance: 500.0 Deposit amount: 200.0 New Balance: 700.0

WITHDRAW -Accept the withdraw amount, then calculate new balance then display the output (if withdraw amount is 300)

Account Number: 1567794657 Current balance: 700.0 Withdraw amount: 300.0 New Balance: 400.0

PRINT MONTHLY STATEMENT -Read Information of the account then dIsplay the following output:

Account Number: 1567794657 End Balance: 400.0

FOR THE DRIVER CLASS Provide an application for a bank named as BankServiceDemo_yourLastName that first display the menu:

BankServiceDemo_Martinez.java MAIN MENU LUIS MARTINEZ Open new account Check current balance Deposit Withdraw Print monthly statement Exit

Task 1: Open new account: -Display message and read from the keyboard for account number, money to open account -Create the new account -then display the output as by calling the method open account from class Account_yourLastName

FROM TASK2 TO TASK5, IF THE ACCOUNT IS NOT OPEN YET, DISPLAY MESSAGE YOU HAVE TO OPEN ACCOUNT BEFORE SELECTING THIS TASK THEN REDISPLAY THE MAIN MENU TO ALLOW USERS TO OPEN ACCOUNT FIRST

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 -Display message to ask how much users want to deposit then call the method deposit of class Account_yourLastName to display the output

Task 4: Withdraw -Display message to ask how much users want to withdraw then call the method withdraw of class Account_yourLastName to display the output

Task 5: Print monthly statement -call the method print monthly statemet of class Account_yourLastName to display the statement

EXIT When users exit display the message box: Thank you. The application is terminating..

COMPILE AND RUN THE PART1 TO GET THE OUTPUT

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..

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!