SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 313 Weeks Ago, 6 Days Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 14 Nov 2017 My Price 10.00

homework assignment gives you the opportunity

Language is C++

Due July 13 at 11.59 pm

I need help ASAP, my apology for not having enough time.

Thanks

 

This homework assignment gives you the opportunity to practice classes, member variables, member functions.

HW4-1 (Graded out of 100) 

Design a bank account class named Account that has the following private member variables:

•       accountNumberof typeint

•       ownerNameof type string

•       balance of type double

 

and the following public member functions:

•       Account() constructor with no arguments, that creates a bank account with a default accountNumber as 9999, a name of an empty string, and balance value of zero. An Account object is dynamically allocated 

•       Account(number, name, bal) constructor with three parameters, that creates a bank account with a specified accountNumber, name and balance. An Account object is dynamically allocated

•       withdraw(amount) function to withdraw a specified amount from the account. The function should first check if there is sufficient balance in the account. If the balance is sufficient, withdrawal is processed.  Otherwise the withdrawal is not made.

•       deposit(amount) function to deposit a specified amount of money to the account. The

function should first check if the deposit amount is positive. If it is positive, deposit is processed.  Otherwise the deposit is not made.

•       getAccountNumber(): An accessor function that returns the account number. This function is later called by the displayAccountInfo() function.

•       getName(): An accessor function that returns the name on the account.

•       getBalance(): An accessor function that returns the account balance. This function is later called by the displayAccountInfo() function.

Demonstrate the class in a program. 1.Additional Requirements

a)What to turn in

Your code should be structured into the following files:

•       Account.h which contains the class definition and the function prototypes of all the member functions

•       Account.cpp which contains the function description of all the member functions Main.cpp file which contains the main function. 

b)Outline of main

Define a global array of pointers to Account, of size MAX_NUM_ACCOUNTS (set MAX_NUM_ACCOUNTS to 5). 

Loop on displaying the following menu of choices:

1.  Create account with complete information (user will be prompted for account number, name and amount)

2.  Create default account with no parameters.

3.  Deposit to account (user will be prompted for account number and amount)

4.  Withdraw from account (user will be prompted for account number and amount)

5.  Display information for all accounts 6.Exit the program.

 

c)Stand-alone function

In addition to the member functions, you should implement displayAccountInfo(), which is not a member function, but a stand-alone function. displayAccountInfo() is called inside the main function. displayAccountInfo() takes as argument a particular Account object and displays the account number, owner’s name and balance for that object. d)Input validation

•       Show an error message if the user tries to deposit to or withdraw from an account number that doesn’t exist. Your program should perform a search on the account number.

•       Show an error message if the user attempts to create an account number that already exists. Your program should perform a search on the account number to verify the account number does not already exist.

•       Show an error message if the withdrawal amount exceeds the balance. No withdrawal should be made in that case.

•       Show an error message if the deposit amount is not positive. No deposit should be made in that case.

•       Do not accept to create an account if the maximum number of accounts has been reached

(MAX_NUM_ACCOUNTS)

e)Style

Make sure you follow the style requirements, especially regarding the comment header for functions, to avoid losing points.

2.Suggestions for implementation

a)Input validation by member functions

When a member function does input validation and detects an invalid input, do not cout an error message in the member function, but instead have the function return an error indication to the calling function. The calling function will then cout an error or perform other appropriate actions. With that method, your class is usable even when input/output other than the keyboard/screen are used. To take the withdraw member function as an example:

b)withdraw member function

/* This function checks the amount to be withdrawn does not

exceed the balance. If the amount does not exceed the balance, the withdrawal is performed, and the function returns true. Else no withdrawal is done, and the function returns false.

*/

bool Account::withdraw(double amnt)

{

// Function definition

}

3.Expected Output

To test your program, type the same input as in the screenshots below, and check the output of your program matches the screenshots.

 

Continued below

Continued below

Continued below

 

 

 

 

 

 

 

Attachments:

Answers

(5)
Status NEW Posted 14 Nov 2017 11:11 AM My Price 10.00

-----------  ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly

Not Rated(0)