You are on page 1of 9

Object Oriented Programming Lab

CSL 210

Lab Journal
Lab # 12

Department of Computer Sciences


BAHRIA UNIVERSITY, ISLAMABAD
Lab Title

Objectives:

 To understand basic concept of I/O Streams.


 To use formatted output using <iomanip>.
 To understand the syntax of opening and closing a file.
 To learn data I/O using text and binary files.
 To understand the use of stream pointers.

Tools Used:

Visual Studio

Submission Date:

Evaluation: Signatures of Lab Engineer:


Task # 1:

Write a C++ program to write Multiplications Tables (from 2-16) in a file called
“Tables.txt”. All the tables should have appropriate title e.g. “Table of 2” and
conventional format for the table entries e.g. “2 x 1 = 2”.

Procedure/Program:
Result/Output:
Task # 2:

Write a C++ program to open a text file and count number of words and characters
in it. Print the output on the screen.
Procedure/Program:

Text File:

Result/Output:
Task # 3:

Write a C++ program to open a text file and print a frequency table of characters
in it. Print the output on the screen.

Procedure/Program:

Text File:
Result/Output:

You might also like