Implement class bankacct for bank usq

Assignment Help C/C++ Programming
Reference no: EM13192800

Implement class BankAcct, for Bank of USQ, using bankacct.cpp and bankacct.h:

- The BSB for Bank of USQ at Towoomba is 324-001.

- A BankAcct object will have a 3 digit bank account number larger than 100 which is a serial number generated by a Serial object. E.g. 324-001-101, 324-001-102, 324-001-103 are the first three possible bank account number for Bank of USQ.

- A BankAcct object will have a bank account pin code which is a 4 digit random number generated by a RandomInt object.

- Class BankAcct should provide a member function to screen display the bank BSB plus account number and the pin code.

Implement an application bankUSQ_app.cpp:

- It will read bankUSQ_account.txt and print out all accounts and pins from the file.

- It will ask user input for the number of bank accounts to generate, and the starting account number.

- Uses class Serial and class RandomInt to generate the account number and the pin code.

- Create BankAcct objects to hold the account number and pin code.

- The BSB (324-001) can be hard coded for screen display only. You do not need to write BSB as part of the account number in bankUSQ_account.txt.

- All generated bank accounts will be store in a vector.

- Before the application exits, it will append the generated accounts to an existing text file named bankUSQ_account.txt. You will need to create an empty bankUSQ_account.txt

before you run the application for the first time.

- Repeat the above steps until the number of bank accounts to generate is 0.

- Assume that all bank accounts generated in each call of the application are unique and not overlapping.

Use Exception to check

- The number of accounts to be created is less than 10. (Assume no negative integers entered.)

- If the input is not valid, the program will ask for user input again.

- You have to use BankError class which is derived from logic_error for exception handling.

- Implement BankError in bankUSQ_app.cpp.

Submit bankacct.cpp, bankacct.h, and bankUSQ_app.cpp and task3.txt. RandomInt class and Serial class files are the same as in Task 1 and 2.
/* Expected output

// bankUSQ_account.txt is empty
Account number: 324-001-1975521678
Pin Code: 0

// 13 is too many, ask for input again
Enter the number of bank account ( < 10), 0 to quit:
13
Too many accounts requested. You requested 13 account numbers. Enter
the number
of bank account ( < 10), 0 to quit:

// 2 is OK
Enter the number of bank account ( < 10), 0 to quit:
2
Enter the start value of account number:
111
Account number: 324-001-111
Pin Code: 8327

Account number: 324-001-112
Pin Code: 3620

// another 2
Enter the number of bank account ( < 10), 0 to quit:
2
Enter the start value of account number:
222
Account number: 324-001-222
Pin Code: 8350

Account number: 324-001-223
Pin Code: 7554

Enter the number of bank account ( < 10), 0 to quit:
0
Quit ...

c\>a

// There are 4 accounts in bankUSQ_account.txt
Account number: 324-001-111
Pin Code: 8327

Account number: 324-001-112
Pin Code: 3620

Account number: 324-001-222
Pin Code: 8350

Account number: 324-001-223
Pin Code: 7554

// too many
Enter the number of bank account ( < 10), 0 to quit:
45
Too many accounts requested. You requested 45 account numbers. Enter
the number


of bank account ( < 10), 0 to quit:

// 3 is OK
Enter the number of bank account ( < 10), 0 to quit:
3
Enter the start value of account number:
333
Account number: 324-001-333
Pin Code: 8435

Account number: 324-001-334
Pin Code: 6869

Account number: 324-001-335
Pin Code: 5797

Enter the number of bank account ( < 10), 0 to quit:
0
Quit ...
// there are 7 accounts in bankUSQ_account.txt now
*/
/* bankUSQ_account.txt
111
8327

112
3620

222
8350

223
7554

333
8435

334
6869

335
5797
*/

Reference no: EM13192800

Questions Cloud

State liquid silicon and carbon monoxide gas : When SiO2 is heated to melting, it reacts with solid carbon to form liquid silicon and carbon monoxide gas. in an industrial preparation of silicon, 155.8 Kg of SiO2 reacts with 78.3 Kg of carbon to produce 66.1 Kg of silicon.
Define sample containing three organic compounds : Sample containing three organic compounds: a hydrocarbon (RH), carboxylic acid (RCOOH), and an amine (RNH2, organic compound with acid-base properties similar tammonia).
State how many water molecules are in a block of ice : How many water molecules are in a block of ice containing 0.750 mol of water (H2O)
Define technician was accidentally exposed to potassium : A technician was accidentally exposed to potassium-42 while doing some brain scans for possible tumors. the error was not discovered until 48h later when the activity of the potassium-42 sample was 2.1?ci .if potassium-42 has a half-life of 12 h
Implement class bankacct for bank usq : Implement class BankAcct, for Bank of USQ, using bankacct.cpp and bankacct.h and Implement an application bankUSQ_app.cpp
State aerosol cans carry clear warnings against incineration : Aerosol cans carry clear warnings against incineration because of the high pressures that can develop upon heating. Suppose that a can contains a residual amount of gas at a pressure of 765mmHg and a temperature of 20?C.
Create a serial object s : The function call operator is overloaded and will generate a sequential integer each time the operator is used and the object can be created with the sequence start value specified.
State how many grams of product are produced : A piece of magnesium (mass=16.2 grams) reacts completely with 10.7 grams of oxygen. In the second reaction you have 61.4 grams of magnesium and 103.7 grams of oxygen
Generate a random number each time the operator is used : The function call operator is overloaded and will generate a random number each time the operator is used and objects can be created with the lower and upper bound of the random number specified.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd