Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Modify the Bank Account class you created to have the following additional functionality -When the object is created, it should create two types of account

Modify the Bank Account class you created to have the following additional functionality

-When the object is created, it should create two types of account

oChecking and Saving ( you can user Boolean variables to identify between these accounts)

oInitialize balance on both accounts to $0

oThe constructor calls a method called setAccountPassWord()

setAccountPassWord ()

1.This method asks the user to enter a pin number.

2.It checks to make sure the Pin number is between 4-8 digit numerical value

3.It calls another method called encryptData()

4.the value return from enCryptData is stored as the user security pin number.

enCryptData()

1.This method takes integer value as its argument

2.It encrypts the integer value using mod21 encryption security.

3.Returns the encrypted value to calling function.

Example

12345 %21 - this returns 18 which is the remainder

656564 % 21 - this returns 20 which is the remainder

Add the following additional methods

Withdraw ()

1-Asks for security pin.

2-Checks if pin entered matches the user security

a.If not, continue to ask user for security pin until valid pin is entered.

3-Asks if withdraw from checking account or saving account

4-Checks If withdraw amount is less than balance

5-Withdraws the amount, and updates account balance

Deposit()

1-Asks for security pin.

2-Checks if pin entered matches the user security

a.If not, continue to ask user for security pin until valid pin is entered.

3-Asks if withdraw from checking account or saving account

4-Updates account balance with new balance

Transfer()

1-Asks for security pin.

2-Checks if pin entered matches the user security

a.If not, continue to ask user for security pin until valid pin is entered.

3-Asks from and to account to transfer money (checking to saving or saving to checking_

4-Updates both accounts balance

DisplayBalance()

1-Asks for security pin.

2-Checks if pin entered matches the user security

a.If not, continue to ask user for security pin until valid pin is entered.

3-Prints the account balance on both checking and Saving

Test your code with the followings

1-Create an account called myAccount

a.Call DisplayBalance()

2-Deposit $100 in saving account

3-Deposit $150 in checking account

a.Display Balance

4-Transfer $50 from saving account into checking account

a.Display balance

5-Try to withdraw $200 from your saving account and see what happens.You must properly display code and inform the end user if there is not funding in the account

6-Withdraw $25 from saving account

Display Balance

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions