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 December, 2017
City, State tamil nadu, karaikudi


Question Paper

DISTANCE EDUCATION
B.Sc. Computer Science/B.Sc. Computer Science (Lateral)
DEGREE EXAMINATION, DECEMBER 2017.
LAB II PROGRAMMING)
(2007 onwards)
Time Three hours Maximum 100 marks
Examiner has to select ONE question and give it to
the student by LOT system.
Each sub division carries 50 marks.
1. Write a menu driven program to add and
subtract the given two matrices of order m n
defined in class, using operator overloading.
Create a class called TIME that has integer data
elements for hours, minutes, seconds. The
constructors should initialize these data elements to
specified value, if given, and otherwise to 0.
A member function should display it, in 11:50:45
format. The final member function should add two
objects of type Time passed as arguments.
Sub. Code
26
DE-9815
2
wkser
2. Assume you want to generate a table of multiples of
any given number. Write a program that allows the
user to enter the number, and then generates the
table, formatting it into ten columns and 20 lines.
Write a program to process students marks with the
help of classes. The class has private variables for
name, mark1, mark2 and mark3. It has two
member functions
getdata( to get input and result( to print the
results. All subjects mark must be 50 for pass
otherwise Fail.
3. Using Pointers, create a class and write a program
to get n names and display them in sorted order.
Create a class Employee that contains employee
number, employee name and address. Write a Menu
driven program to get the number of
employee details and display all details in Employee
name wise sorted order.
4. Write a program using Polymorphism to calculate
the square of any two numbers of type int, float,
double and long.
Create a class DONOR that contains donor number,
donor 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
16 to 25
Female donors having blood group A in the
age between 19 and 24.
Cut here
Cut here
DE-9815
3
wkser
5. 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.
Raising a number n to power p is the same as
multiplying by itself p times. Write a function called
power( that takes a double value for n and an int
value for and returns the result as double value.
Use default argument of 2 for so that if this
argument is omitted, the number will be squared.
Write a main( function that gets values from the
user to test this function.
6. Using dynamic constructors, write a program
to concatenate two given strings.
Create an equivalent for a four-function calculator.
The program should request the user to enter a
number, an operator, and another number. It
should then carry out the specified arithmetical
operations; adding, multiplying, subtracting, and
dividing the two numbers. Finally it should display
the result. When it finishes the calculation, the
program should ask if the user wants to do another
calculation.
7. Write a program to reverse the sentence and
check whether find the given sentence is
palindrome or not.
Write a program which will accept a string of
10 characters in length from the key board and
count the occurrences of each of the five vowels in
the string. The output p should be in a (tapped)
format similar to this example.
A E I O U
0 1 0 0 1
Cut here
Cut here
DE-9815
4
wkser
8. Using operator overloading, write a program to
find the different and total length of given two
various tubes specified in meters and centimeters.
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 int's from -32,768 to 32,767- have the operator
print a warning and terminate the program. Write a
program to test this class.
————————


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