You are on page 1of 2

Object Oriented Analysis and Design

Session: Fall 2019

Lab 06
Topic Static members, static functions, constant member and constant functions.

Objective/ Making students familiarize with the concepts of Static member, Static functions,
Outcome constant member and constant functions.

Note:

1. Please do not use cin in setter and cout in getter


2. Indent your code
3. Comment your code
4. Use meaningful variable names and follow the naming convention
5. Plan your code carefully on a piece of paper before you implement it.
6. Name of the program should be same as the task name. i.e. the first program should be
Task_1.cpp

Task 1
Write a C++ program to make database for a bank to store account information of customers using class and
objects. Display the details such as name, accountNumber (constant), accountType (saving/current) and
balance in the given account number. Information of accounts will be store in a text file.
You have to write in file and store the info into array of objects.
You have to also maintain the count of the objects and display it in the main.

Make parameters and functions constant wherever possible.


Now do the following operations on above mentioned class:

1. Write parameterized constructor with default arguments and copy constructor.

2. Write separate setter functions for each attribute to set value.

3. Write separate getter functions for each attribute to get value.

4. Write a separate function to write all data in file.

5. Write a destructor to release all allocated memories.

6. Write readFile and writeFile functions which should not be the members of class.

Page 1 of 2
File.txt
Ali 443000 saving 23045

Tahir 446700 current 5000


Armghan 443640 saving 100000

Ahmad 443000 current 23895

Numan 443000 saving 28945

Zahid 443000 current 98245

Usman 45900 current 235

Aneel 89753 current 600

Irtza 89003 current 600

Saliha 855553 current 600

Page 2 of 2

You might also like