How To Exam?

a knowledge trading engine...

Alagappa University 2007 M.Sc Computer Science C++ — LAB - Question Paper

Sunday, 17 February 2013 10:35Web

ans 2 ques..
All ques. carry equal marks.
ques. are to be opted by the examiner for every candidate.
ques. I
1. 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 provided and otherwise to 0. A member function should display it, in 11:50:45 format. The final member function should add 2 objects of kind Time passed as arguments.
Create a class DONOR that contains donor number, donor name, age address, sex, blood group.
Write a Menu driven C++ program to display the number, name and address of the donors for the subsequent categories
(a) blood donors having the blood group O+
(b) blood donors in the age group ranging from 16 to 25
(c) female donors having blood group A in the age ranging from 19 and 24.

ques. II
2. Assume you want to generate a table of multiples of any provided 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.
Create a class called Employee that contains Employee number, employee name, designation, basic pay, deductions (LIC, PF). Include a member function to get data from user for ‘n’ employees. Write a C++ program to prepare the payslips for ‘n’ number of employees using the subsequent details :
D.A = 40% of basic pay
H.R.A = 25% of basic pay
Gpay = basic pay + D.A. + H.R.A.
Npay = Gpay – deductions
The outcome of issues is in provided format :
Emp. no Emp. name Basic D.A. H.R.A. L.I.C. P.F. Gpay Npay
– – – – – – – – –

ques. III
3. Using dynamic constructors write C++ program to concatenate 2 provided strings.
Create a class called employee that contains a name and an employee number. Include a member function called getdata( ) to get data from the user, a different function called putdata( ) to display the data. Write a main ( ) program to exercise this class. It should create an array of kind employee and then invite the user to input data for n employees.

ques. IV
4. Create a class Employee that contains a employee number, employee name and address. Write a Menu driven C++ program to get the ‘n’ number of employee details and display all details in employee namewise sorted order.
Create a C++ class for a stock item abstract datatype. It should have the attributes of stock levels (an integer) and unit price (a float). describe the methods to return the values of these 2 attributes and to set them using parameters. Add 2 more methods to allow stock receipt and problems updating the stocklevel as improper. Write a menu driven C++ program to solve the issue.

ques. V
5. Write a program to process students marks with the help of classes. The class has private variables for name, mark 1, mark 2, mark 3. It has 2 member function – getdata ( ) – to get input – outcome ( ) – to print the outcomes. All subjects mark must be >= 50 for pass otherwise fail.
Raising a number n to power p is the identical as multiplying by itself t times. Write a function called power ( ) that makes a double value for n and an int value for p and returns the outcome as double value. Use default argument of two for p, 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.

ques. VI
6. Write a menu driven C++ program to add and subtract provided 2 matrices of order m ? n described in class, using operator overloading.
Create a class Int to Overload all 5 integer arithmetic operators (+, –, *, / and %).
So that they operate on object of kind Int. If the outcome 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.

ques. VII
7. Using pointer create a class and write a program to get the n names and display them in sorted order.
Write a program using polymorphism to compute the square of any 2 numbers of kind int, float, double and long.

ques. VIII
8. Using operator overloading, write a C++ program to obtain the various and total length of provided 2 different tubes specified in meters and centimeters.
Create a equivalent of a four-function calculator. The program should request the user to enter a number, an operator, and a different number. It should then carry out the specified arithmetical operation : adding, multiplying, subtracting, dividing the 2 numbers. Finally it should display the outcome. When if finishes the calculation, the program should ask if the user wants to do a different computation.

( 0 Votes )

Add comment

Security code

Earning:   Approval pending.
You are here: PAPER Alagappa University 2007 M.Sc Computer Science C++ — LAB - Question Paper