1. Pick out the correct option.

A. We cannot make an instance of an abstract base class

B. We can make an instance of an abstract base class

C. Both a & b

D. None of the mentioned

2. Where does the abstract class is used?

A. base class only

B. derived class

C. both a & b

D. None of the mentioned

3. What is the output of this program?

#include <iostream>

using namespace std;

class MyInterface
{
public:
virtual void Display() = 0;
};

class Class1 : public MyInterface
{
public:
void Display()
{
int a = 5;
cout << a;
}
};

class Class2 : public MyInterface
{
public:
void Display() { cout << ” 5″ << endl; }
};

int main()
{
Class1 obj1;
obj1.Display();

Class2 obj2;
obj2.Display();

return 0;

}

A. 5

B. 10

C. 5 5

D. None of the mentioned

4. What does the class definitions in following code represent?

class Bike {
Engine objEng;
};

class Engine {
float CC;
};

A. kind of relationship

B. has a relationship

C. Inheritance

D. Both A and B

5. Which of the following statement is correct about the program given below?

#include<iostream.h>

class Chd {
static int x; // Static member variable

public:
static void SetData(int xx) { // Static member function
x = xx;
}

static void Display() {  // Static member function
    cout << x;
}

};

// Definition of the static member outside the class
int Chd::x = 0;

int main() {
Chd::SetData(44); // Calling static function SetData to set x = 44
Chd::Display(); // Calling static function Display to print x
return 0;
}

A. The program will print the output 0.

B. The program will print the output 44.

C. The program will print the output Garbage.

D. The program will report compile time error.

Other Related Questions

Time & Work

1. During the evaluation of some University exam papers, if the evaluator A can evaluate 240 papers in 8 days and the evaluator B can evaluate 240 papers in 6 days. How many days will A and B together will take to complete the evaluation of 1400 papers? A. 25 B. 20 C. 30 D. 28 View Answer Answer: B. 20 Hide Answer 2. Alan and Border together can finish …

Time & Work

1.A group of (x-1) men work for (x + 1) days while another group of (x + 1) men work for (x + 2) days. Ratio of the amount of the total work done by the two groups is 3: 4. If the efficiencies of all the men are same, then what is the value of x?? A. 8 B. 10 C. 1 D. 11 View Answer Answer: B. 10 …

Time & Work

1. Anil can do the 4 times the actual work in 32 days while Sumit can do the one-third of the original work in 4 days. In how many days will both working together complete the 5 times of the original work? A. 16 B. 17 C. 18 D. 24 View Answer Answer: D. 24 Hide Answer 2. Vipin can complete 60% of a task in 15 days. Pawan is …

Time & Work

1. Ram can do a piece of work in 10 days which Shyam can do in 30 days. They begin together with the condition that Ram shall leave the job 3 days before the actual completion of work. What is the total number of days required to complete the work? A. 14 days B. 10.5 days C. 27 days D. 9.75 days View Answer Answer: D. 9.75 days Hide Answer …

Time & Work

1. Two persons A and B can do a work alone in 29 days. A takes the rest of one day after every 4 days and B takes the rest of one day after every 5 days. If A and B starts working together, then the work will be completed on A.15th day B. 16th day C. 17th day D. 18th day View Answer Answer: C. 17th day Hide Answer …

Time & Work

1. John’s efficiency is 2/3rd Jane’s efficiency. John starts off two pieces of work and works for a day alone and Jane joins him for the next half a day. As John leaves after that, Jane bucks up and triples her efficiency. If she can finish the remaining work alone in 4 hours, then in how much time could John and Jane together do double of that piece of work …

Time & Work

1. A, B, C can complete a job in 4 days, 8 days and 16 days respectively. They starts the work and A leaves after one day. The other two completes the job. C got Rs. 240 out of the total Rs. 900 paid to all three. As A was unwell on first day he could not work at his usual capacity. Find the % of his usual capacity at …

Time & Work

1. Anil does a work in 90 days, Bittu in 40 days and Chintu in 12 days. They work one after another for a day each, starting with Anil followed by Bittu and then by Chintu. If the total wages received are Rs 360 and Anil, Bittu, Chintu share them in the ratio of the work done, find their respective individual wages. A. 40,60,260 B. 36,81,243 C. 42,86,232 D. 38,88,234 …

Categories: