C ++ job 04

xiaoxiao2021-03-06  119

Banking with class

This assignment is to write a banking program using objects. The ChkgAcct class should provide all the functionality as described below. A suggested definition for ChkgAcct is given below. Note that none of your member functions should perform any input (from the keyboard) or output .......................

You Should Also Write a Main Program (a "Client" for your class) That creates an array of 10 accounts (0..9). The you will prompt the user for an account number (0..9). If the user enters a number in the range of 0..9, prompt for the transaction type (telling the user what their options are), then amount if necessary, and then prompt for the next account number. Allow the user to enter any account number out of the range (0..9) to quit the program. The client program should make sure that the user has entered a positive value. Part of the score for this project is for the user interface. All of your prompts should be clear.

A sample class declaration and sample member function are provided to help you get started. You will need to fully define each of the member functions. The examples below are not commented, make sure your submitted program is commented appropriately.

Class chkgacct {

PUBLIC:

Chkgacct ();

Void Deposit (double AMT);

Bool Checkwithdraw (Double AMT);

Bool atmwithdraw (double AMT);

Double getBalance ();

Private:

Double balance;

}

Chkgacct :: chkgacct () {

BALANCE = 100.0;

}

Class Chkgacct Provides The Following Services:

Deposit accepts as an argument the Amount to be deposited. Increas the balance by the deposite number.

Checkwithdrawal Accepts as an argument the amount to be withdrawn. If there are sufficient funds in the account to cover the amount requested, the amount requested is deducted from the balance. If there are insufficient funds a $ 10.00 service charge is deducted from the account instead. ATMwithdrawal This should work like a check, with two exceptions. First, a $ 1 service charge is deducted from the balance for each completed transaction. Second, If there are insufficient funds for the transaction, the transaction is not made and no service charges are deducted From the account.

CurrentBalance Returns the Balance.

Initialization (Constructor) All Bank Accounts Should Begin with $ 100.00. You Should Also Initialize The Appropriate Variables To Keep Track of The Transactions, IF Applicable.

Note: Accounts May Go NEGATIVE DUE to Service Charges.

EXTRA CREDIT:. Track the transactions on the account, so can print a record showing 55 transactions you the last (up to) 50transactions on an account If there were, then you should display the most recent 50 transactions Additional requirement:. For this assignment Divide Your Program INTO Three Files (.cpp and .h) and one for main.) The class definition goes in a Header File, the class member function definition goes in a second file (.cpp), and The Client Code in A Third File. If you are Working In A Visual Project Environment (C Builder, Visual C ), you will need to your project.

STYLE: I Will Start To Take Off Points for Poor Style in Your Code.

Think about making your code readable. Avoid line wrap (in almost all cases a line can be shorted so that it will not wrap around when it prints). If possible, print your program from a developement environment (VC , UltraEdit), because then . the environment will show syntax highlighting in the printout (I will give a few extra points if you print from from an development environment) .Demo: you will demo your program for your lab instructor next week, so make sure you bring your files so You can Run The Program and a Protout of the program.

转载请注明原文地址:https://www.9cbs.com/read-100908.html

New Post(0)