ওডেস্ক এর কিছু কিছু টেস্ট এর উত্তর -পর্ব ১

9
1091
ওডেস্ক এর কিছু কিছু টেস্ট এর উত্তর -পর্ব ১

জামিল হোসেন সিজান

_-_-_-_-_-_-_-_-_-_-_-_-_-
m bad for bad people,I am good for honest people.
I love poor people and poor baby.
_-_-_-_-_-_-_-_-_-_-_-_-_-
আমি ভালোর জন্যখুবই ভাল এবং খারাপের জন্য খুবই খারাপ.আমি গরীব শিশু ও গরীব মানুষদের খুব ভালবাসী..সুতরাং সাবধান.....
ওডেস্ক এর কিছু কিছু টেস্ট এর উত্তর -পর্ব ১

অনেকে নতুন নতুন odesk.com এ কাজ করে থাকেন,,,,ওডেস্ক এ আবার অনেকে পাস করতে পারেন না বলেই, ওডেস্ক এ ঠিক মত কাজ করতে পান না….কার ওডেস্ক এ টেস্ট এর উত্তর গুলো বেশ জটিল….তাই কথা আর বাড়ালাম না…টেস্ট এর উত্তর গুলো নোট পেড এ সেইভ করে রাখেন,,,,কাজে লাগতে পারে….এগুলো টেস্ট এর উত্তর কোথাও পাওয়া যাই না,,,আর কেউ হেল্প করতে চান না…আসলে এগুলো শেয়ার করলে অনেক কিছু জানা যাই,,,ধন্যবাদ..মন্তব্য করতে ভুলবেন না….আজ আমি কিছু শেয়ার করলাম…

tunerpage ওডেস্ক এর কিছু কিছু টেস্ট এর উত্তর -পর্ব ১

Microsoft Excel

Q:You start Microsoft Excel and you do not want it to automatically run a macro upon starting. What will you do?

Ans:Hold down the CTRL key during startup

Q:How does the AutoComplete feature in Excel help you save time?

Ans: It automatically completes abbreviated words

Q:The figure shows a view of the Standard Toolbar. What function is performed by the button marked by the letter ‘Z’?

Ans: It copies the formatting properties from one cell to another

Q:The figure shows the AutoFit Selection menu option. What function does it perform?

Ans: It automatically resizes the column height and width to the minimum necessary to fit the contents of the selected cell

Q:The figure shows a view of the Standard Toolbar. What function is performed by the button marked by the letter ‘A’?

Ans: It is used to add a hyperlink

Q:Which of the following options would be used if you need to insert a 77889867810070809 number in a cell?

Ans: Apply the Text Format to empty cells, and then type the numbers

Q:What is the quickest way to select all the columns on a worksheet?

Ans: Click on the gray rectangle on the upper left corner of the worksheet where the column headings and row headings meet

Q:Suppose the value in cell A1 is John and B1 is Smith then which of the following function you will use to get the John_Smith in C1 cell?

Ans: A_B

Q:How can you select all the blank cells in your worksheet?

Ans: This must be done manually as it is not automated through any built-in feature

Q:The figure shows an Excel worksheet. If you want to freeze the row showing the months (row 1) and the column showing the products (column A), what should you do?

Ans: Select the cell A1 and click on Freeze Panes under the menu Window->Freeze Panes

Q:Which of the following functions would return a value of 8?

Ans: b and c

Q:You select the row headings 10, 11 and 12 and then choose the menu option Insert->Rows. What will happen?

Ans: 3 new rows will be inserted after row 9

Q:The figure shows a view of the Drawing Toolbar. What function is performed by the button marked by the letter ‘X’ ?

Ans: It inserts a Diagram or Organization Chart in the worksheet

Q:When using Document Workspaces, you cannot work directly on the Document Workspace copy, but you can work on your own copy which you can update periodically with changes that have been saved to the copy on the Document Workspace site.

Ans: TRUE

Q:You have created a worksheet which consists of confidential data. You want that these values, although present in the worksheet, should remain hidden and as a result the cells containing this data should appear blank in the worksheet. Which method will help you do this?

Ans: Select the cells, open the Window menu and click on Hide

Q:Which of the following Date and Time function you will use to return the serial number of the last day of the month before or after a specified number of months?

Ans: DATEVALUE

Q:The figure shows a view of the Standard Toolbar. What function is performed by the button marked by the letter ‘Y’?

Ans: It adds up the values in the selected cells

Q:Which of the following errors appears when an invalid argument is passed while converting a number from one number system to another system?

Ans: #N/A

Q:Which of the following function you will use to find the highest number in a series of numbers?

Ans: MAX(B1:B3)

Q:You have entered 4/6 as data in a cell without applying any formats to it. By default, Excel will treat this data entry as a:

Ans: Date

Q:What will be the output of the function IF(ISNA(MODE(B1:B4)),0,MODE(B1:B4)) when it is applied to the data series given below?

Ans:#N/A

Q:AutoFilter drop-downs are automatically added in the header row of a list when the list is created.

Ans: TRUE

Q:What does the NOW() function returns?

Ans: Returns the serial number of the current date and time

Q:Which toolbar is shown in the figure?

Ans: Forms toolbar

Q:When you clear the contents from a cell, the formatting of the cell is also lost.

Ans: FALSE

Q:You define a print area in your worksheet, but later you select a smaller range of cells to print and then click Selection under the menu File->Print->Selection. What will happen?

Ans: b

Php5

Question:

What is true regarding this code?

a. setcookie will return false

b. setcookie will return true

c. setcookie will return null

d. Any of the above can happen

Answer: b

Question:

Which of the following is not a correct way of printing text in php5?

a. echo “Plain text”;

?>

b.

c.

d.

Answer a;

Question:

Which of the following is not the correct way of starting a session?

a. session.auto_start

b. session_register()

c. session_initiate()

d. session_start()

Answer: c;

Question:

Which of the following functions do you need to implement HTTP Basic Authentication?

a. authenticate ()

b. header ()

c. basic_auth ()

d. None of the above

Answer: d;

Question:

Which of the following Command Line Interface constant is not defined in the CLI SAPI?

a. STDIN

b. STDOUT

c. STDPRT

d. STDERR

Answer: c;

Question:

Which of the following statements is correct with regard to final and abstract?

a. An abstract class cannot have final methods

b. An abstract class cannot have non abstract methods

c. A final class cannot have abstract methods

d. A final class cannot have final methods

Answer:

Question:

Which composite data types are supported by php?

a. Array

b. Enumeration

c. List

d. Object

e. Integer

Answer: a

Question:

The default value of register_globals in PHP is:

a. Off

b. On

Answer a

Question:

Which of the following is not a valid PHP connection status?

a. aborted

b. normal

c. open

d. timeout

Answer; c

Question:

Choose the correct statement:

a. include() includes and evaluates a specific file

b. require() includes and evaluates a specific file

c. include_once() includes and evaluates a specific file only if it has not been included before

d. require_once() includes and evaluates a specific file only if it has not been included before

e. All of the above

Answer e

Question:

If the session_cache_expire() is not set, then by default the session cache will expire after:

a. 1 hr

b. 2 hrs

c. 3 hrs

d. 4 hrs

Answer: 3

Question:

What will be the output of the following script?

$count=50;

function Argument()

{

$count++;

echo $count;

}

Argument();

?>

a. It will print 50

b. It will print 51

c. It will print 52

d. It will print 1

Answer 1;

Question:

State whether True or False

Paamayim Nekudotayim operator allows access only to the static members of a class?

a. True

b. False

Answer a

Question:

Which of the following statements is true with regard to comparisons in PHP5?

a. With “= =” operator, two object instances are equal if they have the same attributes and values, and are instances of a different class.

b. With “==” operator two object instances are equal if they have the same attributes and values, and are instances of the same class.

c. With (===) operator, object variables are identical if and only if they refer to the same instance of the same class.

d. With (===) operator, object variables are identical if and only if they refer to the different instance of the same class.

Answer c;

Question:

You have to upload a file using form post method:

1

2 Send this file:

3

4

What should be the code in line 3, if the file name to upload is “SalesFile”?

a.

b.

c.

d.

Answer a;

Question:

Which of the following built-in function assist in checking if actually the function exists or not?

a. exists

b. function_exists

c. fexists

d. isFunction

Answer b;

Question:

What will be the output of the following code?

$a = 0.0;

for ($i = 0; $i

a. 0.9

Not Equals

b. 1

Equals

c. 1

Not Equals

d. 1.1

Not Equals

e. None of the above

Answer: c

Question:

What will be the output of the following code?

$i=4;

$j=30;

$k=0;

$k=$j++/$i++;

echo $i . ” ” . $j . ” ” . $k . ” “;

a. 5 31 6

b. 5 31 6.2

c. 5 31 7

d. 4 31 7.5

e. 5 31 7.5

Answer e;

Question:

Which of the following is a not a correct way of commenting in php?

a. //PHP Comment

b. /*PHP Comment*/

c. #PHP Comment

d. /#PHP Comment

Answer d;

Question:

Following is a php code block:

$m=9;

$n=99;

$z=8;

$z=$n++/$m++ + –$z;

echo $z;

what will be the output?

a. 16

b. 18

c. 19

d. 20

e. 17

Answer 18;

Question:

Which of the following is the correct way of specifying default value?

a. function GetDiscount($Type = “Special”) { . . . }

b. function GetDiscount(Type := “Special”) { . . . }

c. function GetDiscount($Type := “Special”) { . . . }

d. function GetDiscount($Type : “Special”) { . . . }

Answre a;

Question:

With reference to the following php script:

print ‘Text Line1′

print ‘Text Line2′

?>

What will be the output on running the script?

a. Text Line1Text Line2

b. Text Line1 Text Line2

c. ‘Text Line1′

d. ‘Text Line2′

e. Error message will be printed

Answer e;

Question:

What will be the ouput of the following code?

for ($i = 0; $i

a. 0

1

2

3

4

5

b. 0

1

3

4

c. 2

d. 0

1

2

4

e. None of the above

Answer b;

Question:

Late PHP versions support remote file accessing for the functions:

a. include()

b. include_once()

c. require_once()

d. Both a and b

e. Both b and c

Answer: e;

Question:

You have designed a user login form as follows:

User Name:

Password:

How can you access the username entered by the user in the ‘Validate.php’ webpage?

a. $var= $_POST[‘username’];

b. $var= $_REQUEST[‘username’];

c. import_request_variables(‘p’, ‘p_’);

$var= $p_username;

d. All of the above

Answer: d

Question:

Which of the following does not represent logical AND operator in PHP?

a. &

b. &&

c. And

d. AND

Answer: a

Question:

Which of the following is not true for a persistent connection?

a. These are not closed even after the execution of the script

b. These are mainly used to increase the efficiency of the system

c. These can’t be converted to non-persistent connections

d. These are preferably not used in the scripts involving transactions

Answer c;

Question:

Which of the following are invalid data types in PHP?

a. string

b. integer

c. float

d. char

e. array

f. object

Answer d

Question:

The Manager and Office classes are as follows:

class Manager{

function printName() {

echo “Manager”;

}

}

class Office{

function getManager() {

return new Manager();

}

}

$ofc = new Office();

???

?>

Which of the following should replace ‘???’ to obtain the value of printName() function?

a. $ofc->getManager()->printName();

b. new Office()->getManager()->printName();

c. $ofc->getManager->printName;

d. Office::getManager()::printName();

Answer a

Question:

The classes are defined as follows:

abstract class BaseCls{

protected abstract function getName();

}

class ChildCls extends BaseCls{

}

Which of the following implementations of getName() is invalid in ChildCls?

a. protected function getName(){}

b. function getName(){}

c. private function getName(){}

d. public function getName(){}

Answer d;

Question:

Which of the following variable declarations within a class is invalid in PHP5?

a. private $type = ‘moderate’;

b. var $term =3;

c. public $amnt = ’500′;

d. protected $name = ‘Quantas Private Limited’;

Answer: b;

Question:

What will be the output of following code?

$arr = “a”;

$arr[0]=”b”;

echo $arr;

echo $arr[0];

a. ab

b. $arr is undefined

c. bb

d. Parse error

Answer c

Question:

For the following code:

the output will be:

a. 171

b. Expressions can’t be used with echo statements

c. 150.7

d. 30 * 5.7

Answer a;

Question:

What is the result of the following expression?

5+2 * 4+6

a. 70

b. 19

c. 34

d. 21

Anwer: b

Question:

What will be the output of following code?

$var = 1 + “-1.3e3″;

echo $var;

a. -1299

b. 1

c. 1-1.3e3

d. Error:cannot add integer and string

An swer: a

Question:

What will be the output of following code?

$var1=”a”;

$$var1=”b”;

echo “$var1 $a”;

a. a b

b. $var1 $a

c. Error: $a is undefined

d. Error: Parse error in line 2 ($$var1 = “b”)

Answer a

Question:

What is the output of the following code?

$a = 500;

$b = 200;

echo $a % 2

* $b;

?>

a. 100

b. 200

c. 500

d. 0

e. Syntax error

Anwer 0;

Question:

What will be the ouput of the following code?

if (-1)

print “true”;

else

print “false”;

?>

a. true

b. false

Answer a

Question:

What will be the output of the following code?

echo 12 . 6;

a. 12 . 6

b. 126

c. 12.6

d. Error: You cannot add integers through the concatenation operator(.)

Answer: 126

Question:

Consider the following sample code:

$x = 0xFFFE;

$y = 2;

$z = $x && $y;

What will be the value of $z?

a. 0

b. 1

c. 2

d. 3

e. 4

Answer: 1

Adobe Photoshop CS3

Ø Changing units on the Info Palette automatically changes the units on Rulers.

TRUE

Ø Which of the following Filters cannot be applied to a Smart Object?

Pattern Maker

Ø With which of the given options does the Signal Strength Meter appear?

It appears when you choose ‘merge to hdr command’

Ø Channels can not be added to which of the following image modes?

Bitmap

Ø Which among the following Modes does not support layers?

All of the above

Ø Which of the following is not true about Filters?

None of the above

Ø Which of the following is not true about the Curves dialog box?

The Curves dialog box lets you adjust up to 14 different points throughout an image’s tonal range

Ø Which of the following Slices is created with the Slice Tool?

User slices

Ø Which of the following features is supported by the EPS file format?

It supports the Grayscale and Bitmap color modes

Ø Which among the following blending modes is available only for the Apply Image and Calculations commands?

Both a and b

Ø What is the use of the Make Work Path command in the Paths palette ?

It can alter the shape of a selection

Ø Which type of information is not displayed by the Info Palette?

It does not display the opacity of the current layer

Ø Which among the following is not a right option for selecting a web-safe color from the Color Palette?

Choose Current Color from the Color Palette Menu

Ø Which keyboard shortcut (windows) will you choose to close a Path?

None of the above

Ø Anti-aliasing option is available for which of the given Tools?

All of the above

Ø Which of the following options displays the Spot Channels in the Channels palette?

B

Ø What happens when Use Legacy is selected as shown in the given picture?

It is used to apply proportionate (nonlinear) adjustments to image pixels

Ø Which option will you select to open the Levels dialog box?

Choose Image > Adjustments > Levels

Ø Which type of images are resolution-dependent?

Vector images

Ø Which Liquify Tool is used to reconstruct a part of a distorted image?

A

Ø In which Format will you save your file to preserve the Alpha channels?

All of the above

Ø Which of the following is not a kind of text type?

Line type

Ø Which option will you select to convert Types to Shapes?

Both b and c

Ø The mask created by the Replace Color command is permanent.

FALSE

Ø Which of the following Layer properties can be animated?

All of the above

Ø Which View will you choose to display a Histogram with no controls or statistics?

All of the above

Ø Which of the given options displays left indent in the Paragraph palette?

B

Ø Which keyboard shortcut (windows) will you choose to group Layers?

Control + G

Ø The Rotate Canvas command does not work on which of the following

All of the above

Ø Which of the Saving commands is available for an image that is managed by a Version Cue Workspace?

Check In

Ø When will the Dynamic shortcuts appear in the Character Palette Menu as shown in the picture?

All of the above

Ø Hanging Punctuation controls the alignment of the punctuation marks for a specific paragraph.

TRUE

Ø Which option will you choose to select all layers of a similar type?

All of the above

Ø Which of the following is not a Color Adjustment command?

Adjustment command

Ø By default, Masks applied to Smart objects are linked to Smart object layers. .

FALSE

Ø A working space is an intermediate color space used to define and edit color in Adobe applications.

FALSE

Ø Which option will you select to remove the existing profile from the document in the given image?

C

Ø You cannot change the order of the Vector masks or working paths in the Paths palette.

FALSE

Ø The Color Replacement Tool does not work in which of the following Image modes?

All of the above

Ø In which of the following Modes can you draw while working with the Shape or Pen tools?

All of the above

Ø The Out Of Gamut option works only on RGB and Lab images

TRUE

Ø Which among the following QuickTime Video formats is supported by Photoshop extended?

MOV

Programming C++

Consider the following code:

#include

using namespace std;

int main()

{

cout << “The value of __LINE__ is ” <

What will be the result when the above code is compiled and executed?

Correct answer is:

c. The code will compile and run without errors

Base class members are made accessible to a derived class and inaccessible to rest of the program by _____.

Correct answer is:

protected access specifier

Which of the following is not a standard STL header?

Correct answer is:

a.

Which of the following are true about class and struct in C++:

Correct answer is:

In a class all members are private by default, whereas in struct all members are public by default

Consider the following code:

#include

using namespace std;

class A

{

public :

A()

{

cout << “Constructor of A\n”; }; ~A() { cout << “Destructor of A\n”; }; }; class B : public A { public : B() { cout << “Constructor of B\n”; }; ~B() { cout << “Destructor of B\n”; }; }; int main() { B *pB; pB = new B(); delete pB; return 0; }

What will be the printed output?

Correct answer is:

Constructor of A Constructor of B Destructor of B Destructor of A

Consider the following code:

class A {

typedef int I; // private member

I f();

friend I g(I);

static I x;

};

Which of the following are valid:

Correct answer is:

a. A::I A::f() { return 0; }

b. A::I g(A::I p = A::x);

c. A::I g(A::I p) { return 0; }

d. A::I A::x = 0;

In the given sample Code, is the constructor definition valid?

class someclass

{

int var1, var2;

public:

someclass(int num1, int num2) : var1(num1), var2(num2)

{

}

};

Correct answer is:

a. Yes, it is valid

Which of the following STL classes is deprecated (ie should no longer be used)

ostrstream

ostringstream

ostream

wostream

Correct answer is:

ostrstream

Which of the following statements are true about C++ vector class?

a. vector::empty deletes all elements of the vector

b. vector::erase can be used to delete a single element and a range of elements of the vector

c. After calling, vector::erase causes some of the iterators referencing the vector to become invalid

d. vector::count returns the number of elements in the vector

e. vector::size returns the number of elements in the vector

f. vector::capacity returns the number of elements in the vector

Correct answer is:

b. vector::erase can be used to delete a single element and a range of elements of the vector

c. After calling, vector::erase causes some of the iterators referencing the vector to become invalid

e. vector::size returns the number of elements in the vector

Consider the following code:

class BaseException

{

public:

virtual void Output()

{

cout << “Base Exception” <

Invoking Exception Test will result in which output?

Correct answer is:

c. Unknown Exception Thrown

What will be the output of the following code?

class b

{

int i;

public:

virtual void vfoo()

{

cout <<”Base “; } }; class d1 : public b { int j; public: void vfoo() { j++; cout <vfoo();

p = &ob2;

p->vfoo();

}

Correct answer is:

b. Base Derived

Report bad answer

What will be the output of the following code?

class A

{

public:

A():pData(0){}

~A(){}

int operator ++()

{

pData++;

cout << “In first “; return pData; } int operator ++(int) { pData++; cout << “In second “; return pData; } private: int pData; }; void main() { A a; cout <

Correct answer is:

b. In second 1 In first 2

Consider the following class hierarchy:

class Base

{

}

class Derived : private Base

{

}

Which of the following are true?

Correct answer is:

d. Derived can access public and protected member functions of Base

Consider the sample code given below and answer the question that follows.

class A

{

public:

A() {}

~A()

{

cout << “in destructor” <

How many times will “in destructor” be output when the above code is compiled and executed?

Correct answer is:

d. A compile time error will be generated because destructors cannot be called directly

Consider the sample code given below and answer the question that follows.

class SomeClass

{

int x;

public:

SomeClass (int xx) : x(xx) {}

};

SomeClass x(10);

SomeClass y(x);

What is wrong with the sample code above?

Correct answer is:

e. The code will compile without errors

A pure virtual function can be declared by _______.

a. equating it to 1

b. equating it to 0

c. equating it to NULL

d. the ‘pure’ keyword

e. the ‘abstract’ keyword

Correct answer is:

b. equating it to 0

Consider the sample code given below and answer the question that follows:

char **foo;

/* Missing code goes here */

for(int i = 0; i

Referring to the sample code above, what is the missing line of code?

Correct answer is:

d. foo = new char*[200];

Consider the following code:

class BaseException

{

public:

virtual void Output()

{ cout << “Base Exception” <

Invoking Exception Test will result in which output?

Correct answer is:

b. Derived Exception

Which of the following is a function that returns a non zero value to indicate an I/O stream error?

a. bad

b. good

c. fail

d. eof

e. err

f. error

g. filerror

h. None of the above

Correct answer is:

h. None of the above

Consider the sample code given below and answer the question that follows.

class Shape

{

public:

virtual void draw() = 0;

};

class Rectangle: public Shape

{

public:

void draw()

{

// Code to draw rectangle

}

//Some more member functions…..

};

class Circle : public Shape

{

public:

void draw()

{

// Code to draw circle

}

//Some more member functions…..

};

int main()

{

Shape objShape;

objShape.draw();

}

What happens if the above program is compiled and executed?

Correct answer is:

e. None of the above

Consider the code given below and answer to the question.

#include

using namespace std;

class b

{

int i;

public:

void vfoo()

{ cout <<”In Base “; } }; class d : public b { int j; public: void vfoo() { cout<vfoo();

p = &ob2;

p->vfoo();

ob2.vfoo();

}

Correct answer is:

In Base In Base In Derived

Which of the following statements about constructors and destructors are true?

a. In a given class, constructors are always required to be defined, but destructors are not

b. Neither constructors nor destructors can take parameters

c. Constructors can take parameters, but destructors cannot

d. It is illegal to define a destructor as virtual

e. It is illegal to define a constructor as virtual

f. Both explicitly declared constructors and explicitly declared destructors are required in a class

Correct answer is:

c. Constructors can take parameters, but destructors cannot

e. It is illegal to define a constructor as virtual

Consider the following class hierarchy:

class Base

{

}

class Derived : public Base

{

}

Which of the following are true?

Correct answer is:

d. Derived can access public and protected member functions of Base

e. The following line of code is valid: Base *object = new Derived();

Consider the sample code given below and answer the question that follows.

template Run;

Which one of the following is an example of the sample code given above?

Correct answer is:

c. A template function declaration

Consider the sample code given below and answer the question that follows.

class X {

int i;

protected:

float f;

public:

char c;

};

class Y : private X { };

Referring to the sample code above, which of the following data members of X are accessible from class Y

Correct answer is:

a. c

b. f

Consider the following statements relating to static member functions and choose the appropriate options:

1. They have external linkage

2. They do not have ‘this’ pointers

3. They can be declared as virtual

4. They can have the same name as a non-static function that has the same argument types

Correct answer is:

c. Only 1 and 2 are true

Which of the following operators cannot be overloaded?

a. +=

b. >>

c.

Correct answer is:

d. .

e. ::

h. ?:

Consider the sample code given below and answer the question that follows.

class Person

{

string name;

int age;

Person *spouse;

public:

Person(string sName);

Person(string sName, int nAge);

Person(const Person& p);

Copy(Person *p);

Copy(const Person &p);

SetSpouse(Person *s);

};

Which one of the following are declarations for a copy constructor?

Correct answer is:

d. Person(const Person &p);

State which of the following is true.

a. Function templates in C++ are used to create a set of functions that apply the same algorithm to different data types

b. Classes in C++ are used to develop a set of type-safe classes

c. C++ is useful for developing collection classes

d. C++ is useful for developing smart pointers

e. All of the above

Correct answer is:

e. All of the above

What is true about Function?

a. Functions can be overloaded

b. Functions can return the type void

c. Inline functions are expanded during compile time to avoid invocation overhead

d. You can create arrays of functions

e. You can pass values to functions by reference arguments

f. You can return values from functions by reference arguments

g. A function can return a pointer

Correct answer is:

d. You can create arrays of functions

Which of the following techniques should you use to handle a constructor that fails?

a. Return an error code from the constructor

b. Throw an exception from the constructor

c. Write the error to a log file

d. Use “delete this;” in the constructor

e. None of the above

Correct answer is:

b. Throw an exception from the constructor

What access specifier allows only the class or a derived class to access a data member?

a. private

b. protected

c. default

d. virtual

e. public

Correct answer is:

b. protected

Consider the following code:

#include

int main(int argc, char* argv[])

{

enum Colors

{

red,

blue,

white = 5,

yellow,

green,

pink

};

Colors color = green;

printf(“%d”, color);

return 0;

}

What will be the output when the above code is compiled and executed?

Correct answer is:

d. 7

Which of the following are NOT valid C++ casts?

a. dynamic_cast

b. reinterpret_cast

c. static_cast

d. const_cast

e. void_cast

Correct answer is:

e. void_cast

Consider the code given below and refer to the question.

class BaseException

{

public:

virtual void Output()

{

cout << “Base Exception” <

Invoking Exception Test will result in which output?

Correct answer is:

a. Base Exception

Which of the following is NOT a standard sorting algorithm:

a. std::sort

b. std::qsort

c. std::stable_sort

d. std::partial_sort

Correct answer is:

b. std::qsort

How many arguments can be passed to an overloaded binary operator?

a. 4

b. 3

c. 2

d. 1

e. 0

Correct answer is:

d. 1

Which of the following is a predefined object in C++ and used to insert to the standard error output?

a. std::err

b. std::error

c. std::cerror

d. std::cerr

e. std::cin

f. std::clog

Correct answer is:

d. std::cerr

Which of the following statements are true?

a. Inline functions should be preferred over macros because inline functions have better performance

b. Macro usage should be avoided because they are error prone

c. Normal functions should be preferred over macros because normal functions have better performance

d. Macro usage should be avoided because macros do no perform type checking

e. Inline functions should be preferred over macros because inline functions perform type checking

Correct answer is:

b. Macro usage should be avoided because they are error prone

d. Macro usage should be avoided because macros do no perform type checking

e. Inline functions should be preferred over macros because inline functions perform type checking

Consider the sample code given below and answer the question that follows.

class Outer

{

public:

class Inner

{

int Count;

public:

Inner(){};

};

};

int main()

{

Inner innerObject;

Outer outObject;

return 0;

}

What will be the result when the above code is compiled?

Correct answer is:

d. There will be an error because in the declaration of innerObject the type Inner must be qualified by Outer

Consider the sample code given below and answer the question that follows.

1 class Car

2 {

3 private:

4 int Wheels;

5

6 public:

7 Car(int wheels = 0)

8 : Wheels(wheels)

9 {

10 }

11

12 int GetWheels()

13 {

14 return Wheels;

15 }

16 };

17 main()

18 {

19 Car c(4);

20 cout << “No of wheels:” < Which of the following lines from the sample code above are examples of data member definition?

Correct answer is:

e. 19

What is the output of the following code segment?

int n = 9;

int *p;

p=&n;

n++;

cout << *p+2 << “,” <

Correct answer is:

c. 12,10

Which of the following statements are FALSE with regard to destructors?

a. A derived class can call the destructor of the parent class explicitly

b. A class may have only one destructor

c. Destructors cannot be invoked directly

d. The return type for a destructor is void

e. Destructors cannot accept arguments

Correct answer is:

a. A derived class can call the destructor of the parent class explicitly

If a matching catch handler (or ellipsis catch handler) cannot be found for the current exception, then the following predefined runtime function is called ______.

a. abort

b. set_terminate

c. terminate

d. close

Correct answer is:

c. terminate

Sample Code

typedef char *monthTable[3];

Referring to the code above, which of the following choices creates two monthTable arrays and initializes one of the two?

Correct answer is:

e. monthTable winter,spring={“March”,”April”,”May”};

What happened when the following code is compiled and executed?

#include

using namespace std;

class myclass

{

private:

int number;

public:

myclass()

{

number = 2;

}

int &a()

{

return number;

}

};

int main()

{

myclass m1,m2;

m1.a() = 5;

m2.a() = m1.a();

cout<

return 0;

}

Correct answer is:

b. The printed output will be 5

Which of the following member functions can be used to add an element in an std::vector?

a. add

b. front

c. push

d. push_back

Correct answer is:

a. add

Which of the following techniques should you use to handle a destructor that fails?

a. Return an error code from the destructor

b. Throw an exception from the destructor

c. Write the error to a log file

d. Use “delete this;” in the destructor

e. None of the above

Correct answer is:

c. Write the error to a log file

Which of the following are NOT valid C++ casts?

a. dynamic_cast

b. reinterpret_cast

c. static_cast

d. const_cast

e. void_cast

Correct answer is:

e. void_cast

In C++, the keyword auto can be used for:

a. Automatic assignment of data to objects during instantiation

b. Automatic call of a function

c. Declaration of a local variable

d. Automatically erasing an object when it is no longer needed

e. Automatic handling of run-time errors in the program

f. Automatic termination of a program in case the user does not respond within a given time period

g. Automatic creation of variables

Correct answer is:

c. Declaration of a local variable

Which of the following statements are true for operator overloading in C++?

a. The * operator can be overloaded to perform division

b. The * operator can be overloaded to perform assignment

c. ** can be overloaded to perform “to the power of”

d. Operators can be overloaded only in inside classes

e. Operators can be overloaded globally

Correct answer is:

a. The * operator can be overloaded to perform division

b. The * operator can be overloaded to perform assignment

c. ** can be overloaded to perform “to the power of”

d. Operators can be overloaded only in inside classes

Unary operator, overloaded by means of a friend function take one reference argument.

Correct answer is:

a. True

If input and output operations have to be performed on a file, an object of the _______ class should be created.

a. fstream

b. iostream

c. ostream

d. istream

e. None

Correct answer is:

a. fstream

9 মন্তব্য

  1. কি বলে যে আপনাকে ধন্যবাদ দিবো, তা বলার ভাষা আমার নাই !
    অনেক দরকারী জিনিষ আপনি শেয়ার করেছেন !
    আপনার দ্বিতীয় পর্বের অপেক্ষায় থাকলাম !

    ধন্যবাদ !

একটি উত্তর ত্যাগ