Exam Details
Subject | lab ii — (c++ programming) | |
Paper | ||
Exam / Course | b.sc. (cs)/b.sc. (cs) (lateral) | |
Department | ||
Organization | Alagappa University Distance Education | |
Position | ||
Exam Date | May, 2017 | |
City, State | tamil nadu, karaikudi |
Question Paper
DISTANCE EDUCATION
B.Sc.(Computer Science/B.Sc.(CS) (Lateral)) DEGREE
EXAMINATION, MAY 2017.
LAB II PROGRAMMING LAB)
(2007 onwards)
Time Three Hours Maximum 100 Marks
Examiner has to select ONE question and give it to
the student by LOT system.
1. Write a menu driven program to add and
subtract given two matrices of order m n defined
in class, using operator overloading.
Write a function called reversit that reverse a
string (an array of char). Use a for loop that swaps
the first and last characters, then the second and
next-to-last characters and so on. The string should
be passed to reversit as an argument. Write a
program to exercise reversit The program should
get a string from the user ,call reversit and print
out the result. Use an input method that allows
embedded blanks. Test the program with
Napolean's famous phrase "Able was I ere I saw
Elba".
Sub. Code
26
DE-9516
2
Wk 3
2. Create a class DONOR that contains donor number,
name, age, address, sex and blood group. Write a
menu driven program to display the number,
name and address of the donors for the following
categories
blood donors having the blood group
blood donors in the age group between
20 and 25
female donors having blood group A in the age
between 20 and 25.
Create a class INT to overload all five integer
arithmetic operators and so that they
operate on objects of type INT. If the result of any
such arithmetic operation exceeds the normal range
of integer from -32768 and 32767 then print the
warning and terminate the program. Write a
program to test this class.
3. Using pointers, create a class and write a program
to get the n names and display them in sorted order.
Write a program using friend function frifunc(
which can act on the classes alpha and beta. Using
constructors fix the values for alpha and beta.
Cut here
DE-9516
3
Wk 3
4. Create a class EMPLOYEE that contains a
employee number, name and address. Write a
program to get the number of employee details
and display all details in employee namewise sorted
order.
Write a program which will accept a string of
characters form the keyboard and count the
occurrences of each of the five vowels in the string.
The output should be in neat format.
5. Using dynamic constructors, Write a program
to concatenate two given strings.
Create a class called employee that contains name
and an employee number. Include a member
function called getdata to get data from the user
another function called putdata to display the
data. Write a main program to exercise this class.
It should create an array of type employee and then
invite the user to input data for n employees.
6. Write a program to process student marks with the
help of classes. The class has private variables for
name, m1, m2, m3. It has two member functions
getdata to get input; result to print the
results. All subject marks must be more than 50 for
pass otherwise fail.
Write a program using polymorphism to calculate
the square of any two numbers of type int, float
double and long.
B.Sc.(Computer Science/B.Sc.(CS) (Lateral)) DEGREE
EXAMINATION, MAY 2017.
LAB II PROGRAMMING LAB)
(2007 onwards)
Time Three Hours Maximum 100 Marks
Examiner has to select ONE question and give it to
the student by LOT system.
1. Write a menu driven program to add and
subtract given two matrices of order m n defined
in class, using operator overloading.
Write a function called reversit that reverse a
string (an array of char). Use a for loop that swaps
the first and last characters, then the second and
next-to-last characters and so on. The string should
be passed to reversit as an argument. Write a
program to exercise reversit The program should
get a string from the user ,call reversit and print
out the result. Use an input method that allows
embedded blanks. Test the program with
Napolean's famous phrase "Able was I ere I saw
Elba".
Sub. Code
26
DE-9516
2
Wk 3
2. Create a class DONOR that contains donor number,
name, age, address, sex and blood group. Write a
menu driven program to display the number,
name and address of the donors for the following
categories
blood donors having the blood group
blood donors in the age group between
20 and 25
female donors having blood group A in the age
between 20 and 25.
Create a class INT to overload all five integer
arithmetic operators and so that they
operate on objects of type INT. If the result of any
such arithmetic operation exceeds the normal range
of integer from -32768 and 32767 then print the
warning and terminate the program. Write a
program to test this class.
3. Using pointers, create a class and write a program
to get the n names and display them in sorted order.
Write a program using friend function frifunc(
which can act on the classes alpha and beta. Using
constructors fix the values for alpha and beta.
Cut here
DE-9516
3
Wk 3
4. Create a class EMPLOYEE that contains a
employee number, name and address. Write a
program to get the number of employee details
and display all details in employee namewise sorted
order.
Write a program which will accept a string of
characters form the keyboard and count the
occurrences of each of the five vowels in the string.
The output should be in neat format.
5. Using dynamic constructors, Write a program
to concatenate two given strings.
Create a class called employee that contains name
and an employee number. Include a member
function called getdata to get data from the user
another function called putdata to display the
data. Write a main program to exercise this class.
It should create an array of type employee and then
invite the user to input data for n employees.
6. Write a program to process student marks with the
help of classes. The class has private variables for
name, m1, m2, m3. It has two member functions
getdata to get input; result to print the
results. All subject marks must be more than 50 for
pass otherwise fail.
Write a program using polymorphism to calculate
the square of any two numbers of type int, float
double and long.
Other Question Papers
Subjects
- application programs
- computer graphics
- internet programming
- lab ii — (c++ programming)
- lab iii — application programs
- lab iv (visual basic and oracle)
- lab v — java programming
- object oriented programming and c++
- operating systems
- rdbms
- visual programming