Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

need help making this program in c++ will need 5 files for this . can you seperate the files also plz rememeber i need a

need help making this program in c++ will need 5 files for this . can you seperate the files

also plz rememeber i need a print() and test() function for the cpp files . im having alot of trouble making this ASAP!

File Names: project1main.cpp, project1exceptions.h, statistics.cpp, statistics.h, bankaccount.cpp, bankaccount.h

Goal: Requirement Specifications We will first write a class that provides facilities for statistical computations (such as calculating sum, average, minimum, maximum, variance, and standard deviation) for data that is stored in an dynamically allocated array. Then you will use that class to implement applications that will use this statistical package for at least two vastly different application classes. Functional Specifications This project specifies three applications, you must implement the BankAccount Application, and have a choice of implementing the one of the other two applications as a Bonus.

Bank Account Specifications (Required) This Application stores every transaction as soon as a transaction happens. Only amount of the transaction is stored, the date of transaction or any other data is not stored by this class.

When the application starts, it will ask the user about what is the maximum number of expected transactions. You will assume that the balance is zero when the program first starts.

The application will allow the user to make deposits as long as the balance is not above $100,000 FDIC limit.

The application will allow users to withdraw money as long as the withdrawal amount is no more than the available balance.

The application will allow the user to print the available balance at anytime.

The application will also allow the banker to print following statistics regarding the account at any time: balance total deposits total withdrawals average deposit amount average withdrawal amount minimum deposit amount minimum withdrawal amount maximum deposit amount maximum withdrawal amount variance of all the deposits variance of all the withdrawal standard deviation of all the deposits standard deviation of all the withdrawal

Statistics Class [20 points]

This class will provide functions that are shown in the UML class diagram shown below. Their functionalities are obvious from their names, but ask is you are not sure about any one.

The function add() adds a double value at the and of the array.

The function get() obtains a copy of the value stored at the location i.

The function set() overwrites (changes) the value stored at the location i by the provided value.

The printStats() function invokes all other stats related functions and prints them on the screen.

Here are the functions in UML format so you can copy-n-paste

add(value: double): void

get(i: int): double

set(i: int, data: double): void

sum(): double

average(): double

min(): double

max(): double

var(): double

stdev(): double

printStats(): void

BankAccount Class [30 points]

This class will have two instances of Statistics class. One will be used to store deposits and other one will be used to store withdrawals. This is different from how we implemented this class in the Midterm.

Here are the functions in UML format so you can copy-n-paste:

deposit(amount: double): void

withdrawal(amount: double): void

getBalance(): double

getTotalDeposits(): double

getTotalWithdrawals(): double

getAverageDeposit(): double

getAveragWithdrawal(): double

getMinDeposit(): double

getMinWithdrawal(): double

getMaxDeposit(): double

getMaxWithdrawa(): doublel

getVarOfDeposits(): double

getVarOfWithdrawal(): double

getStdevOfdeposits(): double

getStdevOfWithdrawal(): double

printAllStats(): void

Implementation Notes

For every class, all error conditions (in functions where errors can take place) must be identified and exceptions must be written and thrown.

The exceptions must be caught only in the test() and process methods. [10 points]

For every class that you write, please implement a generic print() function [5 points] that prints all the data owned by that class directly or indirectly. Also implement static test() function that tests all other functions without any user input (all values that are otherwise expected from the user will be hard coded), and at least 5 new entries into the array.

Exceptions

All Exception classes can be written inside a single file called myexceptions.h. The constructors and functions of exception classes can be inlined like shown in the class. See lecture on Exceptions.

NoDataException

This exception will be thrown by a function in Statistics class that needs the size of the array to be greater than zero.

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

More Books

Students also viewed these Databases questions