330 - OSS - 2 Set ABC Computer Science
330 - OSS - 2 Set ABC Computer Science
Set A
COMPUTER SCIENCE
(330)
Day and Date of Examination
Signature of Invigilators 1.
2.
General Instructions :
1. Candidate must write his/her Roll Number on the first page of the Question Paper.
2. Please check the Question Paper to verify that the total pages and total number of
questions contained in the Question Paper are the same as those printed on the top of
the first page. Also check to see that the questions are in sequential order.
3. Making any identification mark in the Answer-Book or writing Roll Number anywhere
other than the specified places will lead to disqualification of the candidate.
62/OSS/2-330-A ] 1 [ Contd...
COMPUTER SCIENCE
(330)
6. Write a C++ program to find the smallest of three accepted number a, b, c of type integer. 2
7. What will be the output produced by the following code and also mention how many times 3
the loop gets executed ? Assume all header files are imported.
void main( )
{
int i = 0;
while(i< = 15)
{
cout<<i<<endl;
i = i + 3;
}
}
62/OSS/2-330-A ] 2 [ Contd...
8. What will be the output produced by the below given code snippet ? Assume all header files 1
are included.
cout<< “Rain”;
else
cout<<“No rain”;
9. What will be the output produced by the below given code snippet ? Assume all header files 2
are imported.
void main( )
int a = 5;
change(a);
b = 10;
10. Mention the header file that needs to be included for getchar( ) to work. 1
12. Write a bubble sort program to arrange the elements of the array in ascending order, the 4
array consists of 10 elements.
62/OSS/2-330-A ] 3 [ Contd...
13. Write a C++ program to create a structure TEACHER using the following members. 3
Tno : Integer
Create a structure variable T1 and assign the values {12, “ANOOP”, 50000.5} at the time of
initalization.
void main( )
typedef int a;
ab;
b = “anoop”;
cout<<b;
15. Define a class named ADMISSION in C++ with the following description. 4
Private members :
ADM_NO - Integer, to accept admission number in the range 10 to 2000, both exclusive
Public members :
62/OSS/2-330-A ] 4 [ Contd...
16. Answer the questions (i) to (iii) based on the following : 3
class PRODUCT
{
int code;
char Item[20];
protected:
float Qty;
public :
PRODUCT( );
void GetIn( );
void Show( );
};
class WHOLESALER
{
int Wcode;
protected :
char Manager[20];
public :
WHOLESALER( );
void Enter( );
void Display( );
};
class SHOWROOM : public PRODUCT, private WHOLESALER
{
char Name[20], City[20];
public :
SHOWROOM( );
void Input( );
void View( );
};
(i) Which type of inheritance is followed in the above example Single level, Multilevel,
Multiple or any other type ?
(ii) Write the names of all the data members, which are directly accessible by an object of
the class SHOWROOM.
(iii) Write the names of all the member functions which are directly accessible by an object
of the class SHOWROOM.
62/OSS/2-330-A ] 5 [ Contd...
17. Find the output produced by the following program segment. Assume all necessary header 2
files are included.
void main( )
{
int a = 25;
int *b = 2a;
cout<< a << “ ” << *b <<endl;
a++;
cout<< a << “ ” << *b <<endl;
}
18. Write a function in C++ to search for a camera from a binary file “CAMERA.DAT”, contains 3
the objects of camera as defined below. The user should enter the model number and the
function should search and display the details of the camera.
class CAMERA
{
long Model No;
float Megapixel;
int zoom;
char details [100];
public :
void Enter( )
{
cin >> Model No >> Megapixel >> zoom;
gets (Details);
}
void Display( )
{
cout << Model No << Megapixel ( ) << zoom << Details << endl;
}
long Get Model No( )
{
return Model No;
}
}
62/OSS/2-330-A ] 6 [ Contd...
19. What does open( ) function do ? 1
22. Observe the below given table “CAB” and write queries for (i), (ii) & (iii). 3
CAB
62/OSS/2-330-A ] 7 [ Contd...
27. Write a HTML program to design a webpage as shown below. 3
How does coronavirus spread.
Current evidences suggested that
the virus spreads mainly between
people who are in close contact with
each other. A person can be
infected when aerosols containing
the virus are inhaled.
(i) The background of the webpage is yellow.
(ii) The last sentence of the webpage is bold.
(iii) A black colour line to be drawn to cover the entire webpage.
28. Write a HTML program to insert an image in a webpage as per below given specification. 2
(a) the name of the image is “nios.jpeg”, stored in same folder.
(b) the image should have a border of 5 pixels.
-o0o-
62/OSS/2-330-A ] 8 [ Contd...
This Question Paper consists of 31 questions and 8 printed pages.
Set B
COMPUTER SCIENCE
(330)
Day and Date of Examination
Signature of Invigilators 1.
2.
General Instructions :
1. Candidate must write his/her Roll Number on the first page of the Question Paper.
2. Please check the Question Paper to verify that the total pages and total number of
questions contained in the Question Paper are the same as those printed on the top of
the first page. Also check to see that the questions are in sequential order.
3. Making any identification mark in the Answer-Book or writing Roll Number anywhere
other than the specified places will lead to disqualification of the candidate.
62/OSS/2-330-B ] 1 [ Contd...
COMPUTER SCIENCE
330
4. Write a C++ program to find the smallest of three accepted number a, b, c of type integer. 2
7. What will be the output produced by the following code and also mention how many times 3
the loop gets executed ? Assume all required header files are included.
void main( )
{
int i = 0;
do
{
cout << i << endl;
i = i + 3;
} while (i < = 15);
}
62/OSS/2-330-B ] 2 [ Contd...
8. Mention the header file that needs to be included for getchar( ) to work. 1
9. Write a HTML program to insert an image in a webpage as per below given specification. 2
12. Define a class named ADMISSION in C++ with the following description. 4
Private members :
ADM_NO - Integer, to accept admission number in the range 10 to 2000, both exclusive
Public members :
62/OSS/2-330-B ] 3 [ Contd...
13. Answer the questions (i) to (iii) based on the following : 3
class PRODUCT
{
int code;
char Item[20];
protected:
float Qty;
public :
PRODUCT( );
void GetIn( );
void Show( );
};
class WHOLESALER
{
int Wcode;
protected :
char Manager[20];
public :
WHOLESALER( );
void Enter( );
void Display( );
};
class SHOWROOM : public PRODUCT, private WHOLESALER
{
char Name[20], City[20];
public :
SHOWROOM( );
void Input( );
void View( );
};
(i) Which type of inheritance is followed in the above example Single level, Multilevel,
Multiple or any other type ?
(ii) Write the names of all the data members, which are directly accessible by an object of
the class SHOWROOM.
(iii) Write the names of all the member functions which are directly accessible by an object
of the class SHOWROOM.
62/OSS/2-330-B ] 4 [ Contd...
14. What will be the output produced by the below given code snippet ? Assume all header files 1
are included.
Consider the value of variable ‘var’ is 29.
if(var < 33)
cout<< “Rain”;
else
cout<<“No rain”;
15. Write a bubble sort program to arrange the elements of the array in ascending order, the 4
array consists of 10 elements.
16. Write a C++ program to create a structure TEACHER using the following members. 3
Tno : Integer
TName : String of 20 char
TSalary : Decimal Number
Create a structure variable T1 and assign the values {12, “ANOOP”, 50000.5} at the time of
initalization.
Print the Teacher name (Tname).
62/OSS/2-330-B ] 5 [ Contd...
19. What does tellg( ) function return ? 1
22. Observe the below given table CAB and write queries for (i), (ii) & (iii). 3
CAB
62/OSS/2-330-B ] 6 [ Contd...
26. Find the output produced by the following program segment. Assume all necessary header 2
files are included.
void main( )
{
int a = 25;
int *b = 2a;
cout<< a << “ ” << *b <<endl;
a++;
cout<< a << “ ” << *b <<endl;
}
27. Write a function in C++ to search for a camera from a binary file “CAMERA.DAT”, contains 3
the objects of camera as defined below. The user should enter the model number and the
function should search and display the details of the camera.
class CAMERA
{
long Model No;
float Megapixel;
int zoom;
char details [100];
public :
void Enter( )
{
cin >> Model No >> Megapixel >> zoom;
gets (Details);
}
void Display( )
{
cout << Model No << Megapixel ( ) << zoom << Details << endl;
}
long Get Model No( )
{
return Model No;
}
}
62/OSS/2-330-B ] 7 [ Contd...
28. What will be the output produced by the below given code snippet ? Assume all header files 2
are imported.
#include < iostream.h >
void change(int &);
void main( )
{
int a = 5;
cout <<“a = ”<< a <<endl;
change(a);
cout <<“a = ”<< a <<endl;
}
void change(int &b)
{
b = 10;
}
29. Write a < HTML > program to create the following list : 3
-o0o-
62/OSS/2-330-B ] 8 [ Contd...
This Question Paper consists of 31 questions and 8 printed pages.
Set C
COMPUTER SCIENCE
(330)
Day and Date of Examination
Signature of Invigilators 1.
2.
General Instructions :
1. Candidate must write his/her Roll Number on the first page of the Question Paper.
2. Please check the Question Paper to verify that the total pages and total number of
questions contained in the Question Paper are the same as those printed on the top of
the first page. Also check to see that the questions are in sequential order.
3. Making any identification mark in the Answer-Book or writing Roll Number anywhere
other than the specified places will lead to disqualification of the candidate.
62/OSS/2-330-C ] 1 [ Contd...
COMPUTER SCIENCE
(330)
1. What will be the output produced by the below given code snippet ? Assume all header files 1
are included.
Consider the value of variable ‘var’ is 29.
if(var < 33)
cout<< “Rain”;
else
cout<<“No rain”;
5. Write a C++ program to find the smallest of three accepted number a, b, c of type integer. 2
7. What will be the output produced by the following code and also mention how many times 3
the loop gets executed ? Assume all required header files are included.
void main( )
{
int i ;
for (i = 1; i< = 15; i = i + 3)
{
cout<< i <<endl;
}
}
62/OSS/2-330-C ] 2 [ Contd...
8. What does open( ) function do ? 1
12. Define a class named ADMISSION in C++ with the following description. 4
Private members :
ADM_NO - Integer, to accept admission number in the range 10 to 2000, both exclusive
NAME - array of characters, to store the name
CLASS - character, to store the class
FEES - to store the fees
Public members :
READ_DATA( ) to input data
DISPLAY_DATA( ) to display the data
14. Mention the header file that needs to be included for getchar( ) to work. 1
15. Write a bubble sort program to arrange the elements of the array in ascending order, the 4
array consists of 10 elements.
62/OSS/2-330-C ] 3 [ Contd...
16. Write a function in C++ to search for a camera from a binary file “CAMERA.DAT”, contains 3
the objects of camera as defined below. The user should enter the model number and the
function should search and display the details of the camera.
class CAMERA
{
long Model No;
float Megapixel;
int zoom;
char details [100];
public :
void Enter( )
{
cin >> Model No >> Megapixel >> zoom;
gets (Details);
}
void Display( )
{
cout << Model No << Megapixel ( ) << zoom << Details << endl;
}
long Get Model No( )
{
return Model No;
}
}
17. Write a HTML program to insert an image in a webpage as per below given specification. 2
(a) the name of the image is “nios.jpeg”, stored in same folder.
(b) the image should have a border of 5 pixels.
18. Write a C++ program to create a structure TEACHER using the following members. 3
Tno : Integer
TName : String of 20 char
TSalary : Decimal Number
Create a structure variable T1 and assign the values {12, “ANOOP”, 50000.5} at the time of
initalization.
Print the Teacher name (Tname).
62/OSS/2-330-C ] 4 [ Contd...
19. Identify the error in the below given C++ code. 1
void main( )
{
typedef int a;
ab;
b = “anoop”;
cout<<b;
}
22. Observe the below given CAB table and write queries for (i), (ii) & (iii). 3
CAB
62/OSS/2-330-C ] 5 [ Contd...
26. What will be the output produced by the below given code snippet ? Assume all header files 2
are imported.
void main( )
int a = 5;
change(a);
b = 10;
62/OSS/2-330-C ] 6 [ Contd...
27. Answer the questions (i) to (iii) based on the following : 3
class PRODUCT
{
int code;
char Item[20];
protected:
float Qty;
public :
PRODUCT( );
void GetIn( );
void Show( );
};
class WHOLESALER
{
int Wcode;
protected :
char Manager[20];
public :
WHOLESALER( );
void Enter( );
void Display( );
};
class SHOWROOM : public PRODUCT, private WHOLESALER
{
char Name[20], City[20];
public :
SHOWROOM( );
void Input( );
void View( );
};
(i) Which type of inheritance is followed in the above example Single level, Multilevel,
Multiple or any other type ?
(ii) Write the names of all the data members, which are directly accessible by an object of
the class SHOWROOM.
(iii) Write the names of all the member functions which are directly accessible by an object
of the class SHOWROOM.
62/OSS/2-330-C ] 7 [ Contd...
28. Find the output produced by the following program segment. Assume all necessary header 2
files are included.
void main( )
{
int a = 25;
int *b = 2a;
cout<< a << “ ” << *b <<endl;
a++;
cout<< a << “ ” << *b <<endl;
}
-o0o-
62/OSS/2-330-C ] 8 [ Contd...