Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Design a bank account class (StudentAccount) that has the following attributes: o Owners name o Account number o Account balance and the following member functions:

Design a bank account class (StudentAccount) that has the following attributes:

o Owners name

o Account number

o Account balance

and the following member functions:

o a function that will create a new account

o a function that will deposit funds into the account

o a function that will withdraw funds from the account

o a function that will return the current balance of the account

o a function that will display the account information (owners name, account number, and current balance)

o a function that will close the account

o mutator (setter) functions

Notes:

o If a withdraw transaction with an amount that is greater than the current balance is attempted, a $25 fee is deducted from the balance and the transaction is rejected. The user is informed with a displayed message. If the account balance becomes less than zero due to such fees, the account is closed.

o The default constructor initializes the owners name to student, account number to 12345 and the balance to zero.

o When an account is closed, the account information is displayed, and no further activities can be done to that account.

Write a program that demonstrates the IslanderAccount class. It should allow the user to create, deposit, withdraw, check balance, and/or close accounts.

image text in transcribed

Sample Run 1: Would you like to create a new account Y/N? N Exit Sample Run 2: Would you like to create a new account Y/N? Y Use defaultY/N? N Enter Owner's Name: Joe Smith Enter Account Number 34567 Enter Initial Balance in dollars: 100 Enter Choice 1. deposit 2. withdraw 3. get balance 4. display account information 5. close account & exit What would you like to do? 1 What is the amount you would like to deposit in dollars? 200 Current balance is $300 Enter Choice 1. deposit 2. withdraw 3. get balance 4. display account information 5. close account & exit What would you like to do? 2 What is the amount you would like to withdraw in dollars? 500 Invalid amount. Transaction is rejected. Current balance is $275 Enter Choice 1. deposit 2. withdraw 3. get balance 4. display account information 5. close account & exit What would you like to do? 5 Account information: Owner' s Name: Joe Smith Account Number: 34567 Account Balance: $275 Account is CLOSED Exit. Sample Run 1: Would you like to create a new account Y/N? N Exit Sample Run 2: Would you like to create a new account Y/N? Y Use defaultY/N? N Enter Owner's Name: Joe Smith Enter Account Number 34567 Enter Initial Balance in dollars: 100 Enter Choice 1. deposit 2. withdraw 3. get balance 4. display account information 5. close account & exit What would you like to do? 1 What is the amount you would like to deposit in dollars? 200 Current balance is $300 Enter Choice 1. deposit 2. withdraw 3. get balance 4. display account information 5. close account & exit What would you like to do? 2 What is the amount you would like to withdraw in dollars? 500 Invalid amount. Transaction is rejected. Current balance is $275 Enter Choice 1. deposit 2. withdraw 3. get balance 4. display account information 5. close account & exit What would you like to do? 5 Account information: Owner' s Name: Joe Smith Account Number: 34567 Account Balance: $275 Account is CLOSED Exit

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

Learning MySQL Get A Handle On Your Data

Authors: Seyed M M Tahaghoghi

1st Edition

0596529465, 9780596529468

Students also viewed these Databases questions

Question

P (0 Answered: 1 week ago

Answered: 1 week ago