Monday, February 11, 2008

New sample paper


 

Time Duration: 3 Hrs                                    M. M. 70


 

1.


 

  1. Name the header file, to which the following build in functions belong:

    i) strcmp()    ii) isalpha()    iii) isalnum()    iv) strcat()

  1. Will the following program execute successfully? If not, state the reason(s)

    #include<stdio.h>

    void main()

    {

        int s1, s2, num;

        s1=s2=0;

        for(x=0;x<11;x++)

        {

            cin<<num;

            if(num>0(s1+=num; else s2=/num;

        }

        cout<<s1<<s2;

    }

  1. Write definition for a function SumSequence() in C++ with arguments/parameters-double x and int n. the function should return a value of type double and it should perform sum of the following series:

        1/x-3!/x2+5!/x3+7!/x4+9!/x5…….upto n terms

    (Note: the Symbol ! represents factorial of a number i. e., 4!=5x4x3x2x1)

  1. Write an interactive program in C++ to read a string and make a table displaying different types of character in the following format:

For Example:

Input String: The QUICK BROWN fox jumps over the LAZY LITTLE dog.

Uppercase Vowels        6

Uppercase consonants     15

Lowercase Vowels        7

    Uppercase consonants        13

  1. What is this pointer? Explain with example.

2


 

1


 


 


 


 


 


 


 


 


 


 


 


 

4


 


 


 


 

2


 


 


 


 


 


 


 

1

2. 

  1. Rewrite the given program after correcting all errors.

    Class student

    {

        int age;

        char name[25];

        student(char *sname, int a)

        {

            strcpy(name, sname);

            age=a;

        }

        public:

        void display()

        {

            cout<<"age="<<age;

            cout<<"Name="<<name;

        }

    };

    student stud;

    student stud1("Rohit", 17);

    main()

    {

    -------

    ------

    }

  2. Why should I use inline functions in spite of using plain old #define macros?
  3. Write significance of constructor and destructor? What is copy constructor?
  4. Why do we need constructor in class? What do you mean by constructor overloading?
  5. What will be the output of the following code:

    #include<iostream.h>

    clasws dube

    {

        int heingt, width, depth;

        public:

        cube()

        {

            cube(int ht, int wd, int dp)

            {

                height=ht; width=wd; depth=dp;

            }

            int volume()

        {

        return height * width * depth;

    }

2


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 

2

2

2


 

3. 

  1. Differentiate between single inheritance and multiple inheritance? How is containership differ from inheritance?
  2. Define a class Travel in C++ with the description given below

    Private Members :

    T_Code of type string

    No_of_Adults of type integer

    No_of_Children of type integer

    Distance of type integer

    TotalFare of type float

    Public Members :

    • A constructor to assign initial values as follows :

    T_Code with the word "NULL"

    No_of_Adults as 0

    No_of_Children as 0

    Distance as 0

    TotalFare as 0

    • A function AssignFare( ) which calculates and assigns the value of the data     member TotalFare as follows :

    For each Adult

    Fare (Rs) For Distance (Km)

    500 >=1000

    300 <1000 & >=500

    200 <500

    For each Child the above Fare will be 50% of the Fare mentioned in the above     table.

    For example :

    If Distance is 750, No_of_Adults = 3 and No_of_Children = 2

    Then TotalFare should be calculated as

    No_of_Adults * 300 + No_of_Children * 150

    i.e. 3 * 300 + 2 * 150 = 1200

    • A function EnterTraveK ) to input the values of the data members T_Code,     No_of_Adults, No_of_Children and Distance; and invoke the AssignFare( )     function.

    • A function ShowTraveK) which displays the content of all the

    data members for a Travel.

  1. Assuming the class ZOO given below, write functions in C++ to perform following:
    1. Write the objects of ZOO to a binary file.
    2. Read the objects of ZOO from binary file and display them on screen.

    Class ZOO

    {

        char location[20];

        int no_of_animals[10];

        public:

            void readdata()

            {

                cin>>location;

                gets(no_of_animals);

            }

            void writedata()

            {

                cout<<location<<" "<<no_of_animals<<endl;

            }

    };

  1. What is pointer? What is the difference between un-initialized pointer and NULL pointer?

2


 

4


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 

2


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 

  1. Binary search is more efficient than linear search. Why?
  2. Given an array x[6][16] whose base address is 100. calculate the location x[2][5] if each element occupies 4 bytes and array is stored row wise.
  3. Write a menu driven program in C++ to sort the array using selection sort and the bubble sort.
  4. Write a program in C++ to interchange the values of the row and column.
  5. Following is the number of students in different classes, boys and girls separately:

    Class    V    VI    VII    VIII    IX

    Boys    23    18    35    28    31

    Girls    15    18    03    12    07

    Create two linked list called BOYS and GIRLS so that they are stored in the increasing order of the number of students. Merge two lists BOYS and GIRLS so as to make a single list called STUDENTS. Draw the structure of BOYS, GIRLS and STUDENTS.

  6. Define linear and linked list.. Explain with example.    

1

2


 

4


 

2

2


 


 


 


 


 


 


 

3

  1. Write down any two disadvantages of using a database system.
  2. What is a primary key in a table? Define first normal form.
  3. Given the following relation. Answer the questions.

Roll 

Name 

Course 

Class 

Section

1

Punnet

Computer

12

A

2 

Rohit 

Electronics 

12 

B 

3 

Rahul 

Commerce 

12 

C 

4 

Rakesh 

Computer 

12 

A 

5 

Yatin 

Computer 

12 

A 

6 

Jish 

Civil 

12 

D 

7 

Vidhi 

Electronics 

12 

B 

  1. p Roll, Name(Student)
  2. p class, Section(student)
  1. Write the SQL commands for (i) to (vi) and output for (vii) on the basis of the table HSOPITAL:

HOSPITAL

No 

Name 

Age 

Department 

Dateofadm 

Charges 

Sex

1

Sandeep

65

Surgery

23/02/07

300

M

2 

Ravina

24

Orthopaedic

20/01/07

200

F

3 

Karan

45

Orthopaedic

19/02/07

200

M

4 

Tarun

12

Surgery

01/01/07

300

M

5 

Zubin

36

ENT

12/01/07

250

M

6 

Ketaki

16

ENT

24/02/07

300

F

7 

Ankita

29

Cardiology

20/02/07

800

F

8 

Zareen

45

Gynaecology

22/02/07

300

F

9 

Kush

19

Cardiology

13/01/07

800

M

10 

Shailya

31

Nuclear Medicine

19/02/07

400

M

  1. To show all information about the patients of cardiology department.
  2. To list the name of female patients who are in orthopaedic department.
  3. To list names of all patients with their date of admission in ascending order.
  4. Display the patient's name, charges, age for male patients only.
  5. To count the number of patients with age>20.
  6. to insert a new row in the HOSPITAL table with the following data:

        11, 'Ghulam Mustafa', 37, 'ENT',{25/02/07},250,'M'

  1. Give the output of following SQL statements:
    1. Select COUNT(DISTINCT Charges) from HOSPITAL;
    2. Select MIN(Age) from HOSPITAL where Sex='M';
    3. Select SUM(Charges) from HOSPITAL where sex='F';
    4. Select AVG(Charges) from HOSPITAL where Dateofadm<{12/02/07};

2

2

2


 


 


 


 


 


 


 


 


 


 

  1. Give Boolean expression for the logic diagram shown below. Also find out its outputs when a=1, b=1 and c=1.


 


 


 


 


 


 


 


 


 


 

  1. Represent NOT using only NOR gate(s).
  2. Minimise F(w,x,y,z) using Karnaugh map.
  3. Prove (A+B).(A'+C)=(A+B+C).(A'+B+C').(A'+B+C).(A'+B'+C) Algebrically.
  4. Given the following truth table, write the product of sums form of the function F(x,y,z)

x 

y 

z 

F

0

0

0

0

0 

0 

1 

1 

0 

1 

0 

1 

0 

1 

1 

0 

1 

0 

0 

1 

1 

0 

1 

0 

1 

1 

0 

0 

1 

1 

1 

1 

2


 


 


 


 


 


 


 


 


 


 


 

1

2

2

1

  1. Mention one difference between circular and star topologies in networking.
  2. Write the following abbreviations in their full form:

    i.) OSI        ii) GSM    iii) WLL    iv) FTP

  3. What is the function of telnet?
  4. "Bhartiya Connectivity Association" is planning to spread their offices in four major cities in India to provide regional IT infrastructure support in the field of Education & Culture. The company has planned to setup their head office in New Delhi in three locations and have named their New Delhi offices as "Front Office", "Back Office" and "Work Office". The company has three more regional offices as "South Office", "East Office" and "West Office" located in other three major cities of India. A rough layout of the same is as follows :


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 

Approximate distances between these offices as per network survey team is

as follows:

Place From Place To Distance

BackOffice Front Office 10KM

Back Office Work Office 70 Meter

Back Office East Office 1291 KM

BackOffice West Office 790 KM

Back Office South Office 1952 KM

In continuation of the above, the company experts have planned to install the

following number of computers in each of their offices :

Back Office 100

Front Office 20

Work Office 50

East Office 50

West Office 50

South Office 50

(i)    Suggest network type (out of LAN, MAN, WAN) for connecting each of the     following set of their offices :

    • Back Office and Work Office

    • Back Office and South Office

(ii)    Which device you will suggest to be procured by the company for connecting all     the computers with in each of their offices out of the following devices?

    • Switch/Hub

    • Modem

    • Telephone

(iii)    Which of the following communication medium, you will suggest to be     procured by the company for connecting their local offices in New Delhi for     very effective and fast communication?

    • Telephone Cable

    • Optical Fiber

    • Ethernet Cable

(iv)    Suggest a cable/wiring layout for connecting the company's local offices     located in New Delhi. Also, suggest an effective method/technology for     connecting the company's regional offices-"East Office", "West Office" and     "South Office" with offices located in New Delhi.

1

2


 

1


 

**********

*****

**********

No comments: