| |
|
|
COBOL Lab Exercises
Posted by Murugan R, M.E.S.College
Marampally
on 18/06/2008 updated on 23/06/2008 |
Simple
Questions: (Adobe Reader is required to
see the answers)
|
|
| Table
Handling Questions: |
| Write
a COBOL program to add two matrices. 12cob |
| Write
a COBOL program to subtract one matrix from another.
13cob
|
| Write
a COBOL program to multiply two matrices.
14cob |
| Write a COBOL program to sort
a list of names according to the user's choice. |
| Write a COBOL program to read
a two dimensional matrix, find the row total and
column total and display the result in a neat
format. |
| Write a COBOL program to find
the biggest element in a two dimensional matrix
and display its position. |
| A company produces pens. Three
salesmen of the company selling the pens in four
different districts. Read the quantity sold by
each salesman in different districts and find
out the salesman who sold the maximum quantity
also specify the district. |
| Given the product names, sold
quantity and unit price of 5 products sold by
a company. Write a COBOL program to display an
Invoice for the above sales in a neat format. |
| A company produces pens. Three
salesmen of the company selling the pens in four
different districts. Read the quantity sold by
each salesman in different districts. Find out
the quantity sold by each salesman and the quantity
sold in different districts and the total quantity
sold. |
| A Statement gives the quantity
sold by three salesmen in four different zones
of a single product of a company. Write a COBOL
program to print the zones and salesmen who sold
the largest and the smallest quantity. |
|
| |
| File
Handling Questions (only sequential): |
| A
student record contains Register Number, Name
of the Student, Sex, Date of Birth and Place.
Write a COBOL program to read details of a set
of students through the keyboard and stored in
a sequential file and print the contents of the
file in a neat format. 22cob |
| An
employee record contains Badge Number/Employee
Number, Name of Employee, Basic Pay, DA, HRA and
Deductions. Write a COBOL program to accept details
of a set of employees through keyboard and stored
in a sequential file and print the contents of
the file in a neat format. 23cob |
| A sequential file contains the
records of employees of a company having the following
structure: Employee Number, Name, Sex, Basic Pay,
DA, HRA, PF and Other Deduction(Give appropriate
picture clauses). Write a COBOL program to print
pay slips for each employee in a neat format. |
| A student file contain the marks
of students scored in various subjects in a class.
Each record contain Register Number, Name of Student
and Marks scored for Subject1, Subject2 and Subject3(maximum
marks 100). Write a COBOL program to prepare a
Rank List. |
| A sequential
file contains records of consumers of an
electricity board having the following structure:
Consumer Number, Name of Consumer, Previous
Meter Reading and Current Meter Reading(give
appropriate picture clauses). Write a COBOL
program to print the Electricity Bill for
each consumer in a neat format according
to the following slab: |
Consumption |
Rate/Unit(in
Rs.) |
<
50 |
@
1.00 |
50
- 100 |
@
1.25 |
>
100 |
@
1.50 |
|
| A sequential
file contains records of consumers of a
Telecom Services having the following structure:
Consumer Number, Consumer Name, Name of
Exchange, Previous Meter Reading and Current
Meter Reading(Give appropriate picture clauses).
Write a COBOL program to print Telephone
Bill for each consumer in a neat format
according to the following slab: |
Slab |
Consumption |
Rate/Unit(in
Rs.) |
Telehpone
Rent |
I |
First
250 |
@
0.80 |
250 |
II |
Next
600 |
@
1.00 |
300 |
III |
Balance |
@
1.20 |
500 |
|
| A student record contains Register
Number, Name of the Student, Course and Year of
Admin. Write a COBOL program to read details of
a set of students through the keyboard and stored
in a sequential file and generate a list of students
joined for various courses in different year in
suitable order using sort verb of COBOL. |
| Two sorted sequential files
with records contains Register Number and Name
of Student. Write a COBOL program to merge these
two files and print the full list in a neat format. |
|
| |
| |
|