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

  The mean and standard deviation

How do i write a program in c++ that use functions max, min, the total numbers, the mean and standard deviation to read a file text and return these values from the file text. note the file text has random numbers. note im not suppose to use arrays.

  Write a program using for loops t

Write a program using for loops to produce the following output. Please read carefully the entire specification!

  Program to compute and show miles per gallon

Create the program in C++ which will input miles driven and gallons used (both as integers) for each tankful. Program must compute and show miles per gallon.

  Computer programming techniques

Construct a program from a design and use appropriate functions

  Write a small program to simulate a raffle

Write a small program to simulate a raffle (a gambling game) for a group with 100 members. You can simply identify each member with a no-duplicated ID numbers from 01 to 100. A number ticket with a positive 4-digits integer number will be randomly cr..

  Distinguish syntax and purpose of while-loop and for-loop

Distinguish the syntax and purpose of while-loop and syntax of a for-loop. Give C++ code examples of both loops and descriibe the main differences.

  Write a c++ program containing a linked list of 10 integer

Write a C++ program containing a linked list of 10 integer numbers. Have the program display the numbers in the list.

  Image text transcribed for accessibility

Image text transcribed for accessibility: write a program that requires the number of bits for the exponent and significant of a floating point representation, then requires two decimal real numbers and an operation,sum,subtraction or multiplic..

  Program to input the length of the side from the keyboard

write a program to input the length of the side from the keyboard ,use the class to obtain the areas of all shapes and display the results on the screen

  Gcd between two positive integer numbers

Write a C++ code for calculating the GCD (Greatest Common Divisor) between two positive integer numbers. You  should  use Euclid's  original  subtraction  based  GCD algorithm ( not  using  modulo operator). You should write a function following t..

  A company that market is publishing both book and audio cass

A company that market is publishing both book and audiocassette versions

  Presented a number of recurrence relations

For this problem set, you will be presented a number of recurrence relations and asked to state their actual time complexity, showing your work in the process.

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