Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I neeed I pseudo code for this program Your local small bank wants a program that will allow users to get bank informa6on about their

I neeed I pseudo code for this program

Your local small bank wants a program that will allow users to get bank informa6on about their accounts. For this program, you will have two classes: Account and Cer6ficateofDeposit or CD, which will manage two different types of accounts. The Account class will manage checking and savings accounts, which contains account informa6on and balance, and CD will manage a CD account that contains a dura6on and interest rate. Design: You will include the following classes: o Account o Cer6ficateofDeposit o CustomTransac6ons It should include the following: o You are limited to 5 accounts and 5 CD accounts o You must have an ac6ve account to open a CD account. o Only one CD account is allowed per account number. o All data input needs to be validated. o All CD's have varying rates of interest based on the length of the CD: 6 months- 2% 12 months- 3.5% 15 months- 4.2% o When a CD account is opened, the customer chooses the dura6on of the CD, which will determine the rate. o The account number assigned in the Account class will be four digits star6ng at 1 and we will not be able to handle more than 5 accounts. Therefore account numbers will be between 1 and 5. o The account number assigned to the CD object will also be four digits star6ng at 20. Since you must have an account to open a CD and since each account can only have one CD, there will be no more than 5 CD accounts allowed. (I said it was a small bank.) Account class: This class manages the content of a single checking or savings account Instance variables: Account number, which will be four digit int value. However, for this program, we will limit the account numbers to 1-5, but it will display as four digits: 0001 Account holder name Balance, which stores the current balance aWer each transac6on Account type which will store either checking or savings hasCD which is a boolean variable which simply indicates whether the account holder has purchased a CD Sta6c variables: a variable that keeps track of the number of accounts created Methods: Constructor- This constructor should accept the name, star6ng balance and account type. It should increment the number of accounts, set the name, balance and type. It should set the account number to the same value as number of accounts (aWer it has been incremented), and set hasCD to false, as no one will have a CD un6l they have created an account. GeZers for all instance variables. SeZers for account type and owner name, only. deposit(): This method accepts a dollar amount and adds that amount to the balance. It should then output a message indica6ng a success deposit that displays the new balance. withdraw(): This method accepts a dollar amount and subtract that amount from the balance, only if there are sufficient funds to make the withdraw. If there are not enough funds, then display an "Insufficient funds. Withdrawal failed!" message. openCD(): This method sets the value of hasCD to true when called. toString(): This method sets the output of account informa6on: Account Number: 0001 Owner Name: Tonya Pierce Account Type: checking Balance: $150.00 Cer=ficateofDeposit Class: This class manages the details of a single Cer6ficate of deposit Constant variables: All three CD dura6ons and all three interest rates Instance variables: account number- which will start with 20 and will be fall between 20 and 24. Account holders name- This should be obtained from the original account. It should not be entered when the CD is opened. Star6ng amount- This should be the star6ng amount that the account holder deposits. This amount will grow monthly based on the interest rate earned, which is determined by the dura6on. However, we will only store the star6ng amount Dura6on- This is how long the user has chosen: 6, 12 or 15 months Sta6c variables: A variable that keeps track of the number of CDs created Methods: Constructor- This constructor accepts the name, star6ng amount and dura6on and sets those values. Only set the amount if the amount is greater than 0. Otherwise, set the amount to -1. Account number is set based on the total CD accounts + 20. Dura6on should only be set if it is equivalent to one of the three constant values set. Otherwise, dura6on is set to 0. Then increment the total number of CDs

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

Mobile Communications

Authors: Jochen Schiller

2nd edition

978-0321123817, 321123816, 978-8131724262

More Books

Students also viewed these Programming questions