Computer Science - Online Test

Q1. How many types of iteration statements?
Answer : Option B
Explaination / Solution:
No Explaination.


Q2. int age[]={6,90,20,18,2}; How many elements are there in this array?
Answer : Option B
Explaination / Solution:
No Explaination.


Q3. Insulation of the data from direct access by the program is called as
Answer : Option A
Explaination / Solution:
No Explaination.


Q4. A member function can call another member function directly, without using the dot operator called as
Answer : Option C
Explaination / Solution:
No Explaination.


Q5.

Based on the following program answer the question

#include<iostream>

using namespace std;

class Point {

private:

int x, y;

public:

Point(int x1,int y1)

{

x=x1;y=y1;

}

void operator+(Point &pt3);

void show() {cout << "x = " << x << ", y = " << y; } };

void Point::operator+(Point &pt3)

{

x += pt3.x;

y += pt3.y;

}

int main()

{

Point pt1(3,2),pt2(5,4);

pt1+pt2;

pt1.show();

return 0;

}

Which of the following statement invoke operator overloading?
Answer : Option A
Explaination / Solution:
No Explaination.


Q6.

Based on the following class declaration answer the question

class vehicle

{ int wheels;

public:

void input_data(float,float);

void output_data();

protected:

int passenger;

};

class heavy_vehicle : protected vehicle {

int diesel_petrol;

protected:

int load;

protected:

int load;

public:

voidread_data(float,float)

voidwrite_data(); };

class bus: private heavy_vehicle {

charTicket[20];

public:

voidfetch_data(char);

voiddisplay_data(); };

};

Which is the base class of the class heavy_vehicle?

Answer : Option C
Explaination / Solution:
No Explaination.


Q7. Which of the following is not a malicious program on computer systems?
Answer : Option D
Explaination / Solution:
No Explaination.


Q8. Identify the output device
Answer : Option C
Explaination / Solution:
No Explaination.


Q9. Which Boolean algebra property allows us to group operands in an expression in any order without affecting the results of the operation [for example, A + B = B + A]?
Answer : Option B
Explaination / Solution:
No Explaination.


Q10. Which of the following is not the part of a microprocessor unit?
Answer : Option C
Explaination / Solution:
No Explaination.