Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Program Requirements: For this assignment, you will build a dynamic bank account system with various capabilities using classes in C + + . 1 .

Program Requirements:
For this assignment, you will build a dynamic bank account system with various capabilities using
classes in C++.
1. You will create an Account class that defines public and private member data and member
functions, including constructors/destructors, an overloaded operator, etc. In particular, the
Accountclass will be structured as follows:
Account.h
This header file will contain any #includeand using directives along with the actual
classdeclaration containing:
o Three private member variables: (1) an integer pointer for the 4-digit account number,
a string to hold the customers name of the account, and a vector of floating-point
numbers to hold the balance of each account under this name (e.g., a customer may
hold several accounts with the bank).
o At least one public constructor, a constructor overload, a public destructor, public
accessor/mutator member functions for each private variable, and any additional
member functions as needed.
o A static integer variable that holds the next account number available that can be used
as an account number. For example, the first created account will use the integer
1000, so the next available account number will be 1001. This is done class-wide to
keep track of a "global" view of available account numbers.
Account.cpp
o The implementation section will contain the appropriate #include directive to the
Account.h header file as well as applicable constructor(s), destructor, copy
constructor, copy assignment operator, overloaded operator definition, static variable
initialization, accessor/mutator member function definitions, and any additional
member function definitions declared in the header.
2. You will organize the rest of your program into two files as follows:
Project2.h
o The project2.h header file will contain the appropriate #include directive to the
Account.h header file as well as any needed #include and using directives, #define
directives, enumerated data types, structures, type definitions, and the list of function
prototypes (i.e., function definitions).
Project2.cpp
o The project2.cpp implementation source code file will contain the appropriate
#include directive to the Account.h header file (all other #include directives should
be in the project2.h header file), the main () function for the program, and any
supporting function definitions as described below.
3. Implementation of the bank account system will consist of the following:
As with all projects in this course, your programs output will display your name, your
EUID, your e-mail address, the department name, and course number. This means that
your program will print this information to the terminal (see Sample Output).
You will declare and use either a vector or a dynamically allocated array of your Account
data type as a container to hold all of the instantiated Account objects of customer "bank
accounts".
In a loop of your choice, you will repeatedly display a menu of options until the user enters
the selection to terminate the program as follows:
1. Open new account
2. Deposit into account
3. Withdraw from account
4. Print a list of all accounts
5. End transaction (Exit)
Although you may assume that the user enters an integer in response to this menu, the
integer may be out of range. If the user enters an invalid menu option (i.e., not an integer
between 1 and 5, inclusively), your program will display an error message and re-display
the menu. The variable used to read in the users selection will be implemented as an
integer variable, so memory must be dynamically allocated and freed as appropriate.
For each of the menu options except the "5. End transaction (Exit)" option, you will
implement the functionality in separate functions. For example, when the user selects
option 1, you will perhaps call a function called openAccts(...) that will open a new bank
account for the user. Note that you will not use any global variables in this program, so
you must pass any needed data, such as the container (i.e., the vector or dynamically
allocated array), as arguments to the functions.
If the user enters an integer between 1 and 5, inclusively, then your program will perform
the requested operation as follows:
o Open new account
You will prompt the user for and read in the customer account name and initial deposit
amount. The account number will be automatically generated from the static integer
variable defined earlier that holds the next account number available. Using this data,
you will instantiate an Account object for that customer and add it to your container
of customer bank accounts. If successful, you will print a status message with the
account details, formatting any monetary values to dollars and cents with 2 decimal
places.
o Deposit into account
You will prompt the user for and read in the customer account number. If that account number exists in your bank account container, you will then prompt the
user for the customer account name for

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

Database 101

Authors: Guy Kawasaki

1st Edition

0938151525, 978-0938151524

More Books

Students also viewed these Databases questions

Question

What is Change Control and how does it operate?

Answered: 1 week ago

Question

How do Data Requirements relate to Functional Requirements?

Answered: 1 week ago