Object Oriented

March 17, 2017 | Author: soumendu143 | Category: N/A
Share Embed Donate


Short Description

Download Object Oriented...

Description

1.  You can use C++ C++ as a procedural, procedural, as well as as an object-oriented, object-oriented, language A. True B. False View Answer Workspace Report Discuss in Forum 2. A default catch block catches A. all thrown objects B. no thrown objects C. any any thr throw own n obj objec ectt tha thatt has has not not bee been n caug caught ht by an earl earlie ierr catc catch h blo block ck D. all all thr thro own obje objeccts that that hav have e bee been n cau caugh ghtt by by an an ear earli lier er catc catch h blo block ck View Answer Workspace Report Discuss in Forum 3. Adding a derived class to a base class requires fundamental changes to the base class A. True B. False View Answer Workspace Report Discuss in Forum 4. Format flags may be combined using A. the bitwise OR operator (|) B. the logical OR operator (||) C. the bitwise AND operator (&) D. the logical AND operator (&&) View Answer Workspace Report Discuss in Forum 5.  The use of the break break statement in a switch statement statement is A. optional B. compulsory C. not a llllowed. It gives an er ro ror message D. to check an error E. None of the above 6.  To expose a data member member to the program, program, you must declare the the data member member in the _____ section section of the class class A. common B. exposed C. public D. unrestricted E. user View Answer Workspace Report Discuss in Forum 7. Evaluate the following expression: 3 >6&&7>4 A. True B. False View Answer Workspace Report Discuss in Forum 8. Which of the following are valid characters for a numeric literal constant? A. a comma B. a dollar sign ($) C. a percent sign (%) D. a space E. None of the above View Answer Workspace Report Discuss in Forum 9. A function that changes the state of the cout object is called a(n) _____  A. member B. adjuster C. manipulator D. operator View Answer Workspace Report Discuss in Forum 10. A C++ program contains a function with the header int function(double function(double d, char c). Which of the following function headers could be used within the same program? A. char function(double d, char c) B. int function(int d, char c) C. both (a) and (b) D. neither (a) nor (b) 11. When the compiler cannot differentiate between two overloaded constructors, constructors, they are called A. overloaded B. B. destructed C. ambiguous D. D. dubious View Answer Workspace Report Discuss in Forum 12. Some Streams work with input, and some with output A. True B. False View Answer Workspace Report Discuss in Forum 13. If you design a class that needs special initialization tasks, you will want to design a(n) _____  A. housekeeping routine B. initializer C. constructor D. compiler View Answer Workspace Report Discuss in Forum 14. Which type of statement does not occur in computer programs? programs? A. sequence B. loop C. denial D. selection View Answer Workspace Report Discuss in Forum 15.

1

 The newline character character is always always included between between A. pair of parentheses B. pair of curly braces C. control string D. & E. None of the above 16.  To be called object-oriented, object-oriented, a programming programming language must must allow A. functions th that re return on only a singl e val ue ue B. #include files C. inheritance D. All of the above View Answer Workspace Report Discuss in Forum 17. A function that returns no values to the program that calls it is _____  A. not allowed in C++ B. type void C. type empty D. type barren View Answer Workspace Report Discuss in Forum 18.  The keyword used used to define a structure structure is _____  _____  A. stru B. stt C. struct D. structure View Answer Workspace Report Discuss in Forum 19. If container classes are carefully constructed, then these tools are available to work with structures that are not ______  A. valid without container classes B. programmer-defined C. type-specific D. public View Answer Workspace Report Discuss in Forum 20. Header files often have the file extension _____  A. .H B. .HE C. .HEA D. .HEAD 21.  The #ifndef directive directive tests to see whether whether ________  A. a class has been defined B. a variable has been given a value C. a class has no va variable definitions D. any any ob object jectss of of the the clas lass ha have been been inst instan anti tiat ated ed View Answer Workspace Report Discuss in Forum 22. Which of the following statements is false? A. A fun funct ctio ion n is is a bloc blockk of of cod code e tha thatt per perfo form rmss a spec specif ific ic task task B. Funct Function ionss allow allow progra programm mmers ers to brea breakk large large and comp complex lex proble problems ms into into smal smalll and and mana managea geable ble tasks tasks C. Func Functi tion onss allo allow w pro progr gram amme mers rs to use use exis existi ting ng code code to to per perfo form rm comm common on task taskss D. Func Functi tion onss can can be call called ed,, or or inv invok oked ed,, onl only y onc once e in in a prog progra ram m E. Prog Progra ramm mmer er-d -def efin ined ed func functi tion onss can can be eith either er valu valuee-re retu turn rnin ing g or void void View Answer Workspace Report Discuss in Forum 23.  The generic type in a template function function A. must be T B. can be T C. cann cannot ot be T for for func functi tion onss you you cre creat ate, e, but but may may be for for C++ C++'s 's bui built lt-i -in n fun funct ctio ions ns D. cannot be T View Answer Workspace Report Discuss in Forum 24. When a child class function is called, the compiler looks first for a matching function name in the _____  A. class of of th the ob obj ec ect us using th the fu functi on on na name B. immediate ancestor class C. base class D. descendant class View Answer Workspace Report Discuss in Forum 25. A function that is called automatically each time an object is destroyed is a A. constructor B. B. destructor C. destroyer D. terminator 26. If you create an instantiation of a class template with an i nt, and then create a second instantiation with a double, then A. you you mus mustt pre prece cede de each each func functi tion on call call with with the the wor word d int int or doub double le B. once once a func functi tion on is is use used d as one one type type,, it beco become mess una unava vail ilab able le for for use use wit with h the the othe otherr type type C. ther there e is is no no dif diffe fere renc nce e in the the proc proced edur ure e to to cal calll a mem membe berr fun funcction tion D. you ca cannot pe pe rf rform this op operation in in C++ View Answer Workspace Report Discuss in Forum 27.  The step-by-step instructions instructions that solve solve a problem are called _____  _____  A. B. C. D.

an algorithm a list a plan a sequential structure

2

View Answer Workspace Report Discuss in Forum 28.  The type to be used in an instantiation of a class template template follows ________  ________  A. the generic class name B. the keyword template C. the keyword class D. the te template de definition View Answer Workspace Report Discuss in Forum 29. Which of the following statements allows the user to enter data at the keyboard? A. cin > currentPay; C. cout > currentPay; E. None of the above View Answer Workspace Report Discuss in Forum 30. When you pass a v ariable _____, C++ passes only the contents of the variable to the receiving function A. by reference B. by value C. globally D. locally 31.  The best form of coupling is _____  A. complete B. tight C. loose D. free View Answer Workspace Report Discuss in Forum 32. Paying attention to the important properties while ignoring inessential details is known as________  A. selectiveness B. polymorphism C. abstraction D. D. summarizing View Answer Workspace Report Discuss in Forum 33. What does C++ append to the end of a string literal constant? A. a space B. a number sign (#) C. an asterisk (*) D. a null character View Answer Workspace Report Discuss in Forum 34. An array name is a _____  A. subscript B. formal parameter C. memory address D. prototype View Answer Workspace Report Discuss in Forum 35.  To enter a comment comment in a program, program, you begin begin the comment comment with _____  A. ** B. && C. \\ D. @ E. // 36. Which of the following is(are) invalid string constant(s)? A. '7.15 pm' B. "i like e" C. "7.3el2" D. "1234el2" E. None of the above View Answer Workspace Report Discuss in Forum 37.  You define a structure structure type globally because because _____  A. you save save many many lines lines of of code code by by not not rewrit rewriting ing an iden identic tical al stru structu cture re defi definit nition ion in each each functi function on that that uses uses it B. you wi will ne never ch change itits de definition C. it is required in C++ D. All of the above View Answer Workspace Report Discuss in Forum 38. Overloaded functions are required to A. have the same return type B. have the same number of parameters C. perform the same basic functions D. None of the above View Answer Workspace Report Discuss in Forum 39. Redirection redirects A. a stream from a file to the screen B. a file from a device to a stream C. a device from the screen to a file D. the screen from a device to a stream View Answer Workspace Report Discuss in Forum 40.  You mark the the beginning of a function's function's block of code with the the _____ 

3

A. / B. * C. { D. } E. either (c) or (d) can be used 41. Sending a copy of data to a program module is called _______  A. passing a value B. making a reference C. recursion D. setting a condition View Answer Workspace Report Discuss in Forum 42. Of the three ways to pass arguments to functions, only passing by _____ and passing by _____ allow the function to modify the argument in the calling program A. reference, pointer B. array, location C. pointer, reference D. None of the above View Answer Workspace Report Discuss in Forum 43.  To use either an input input or output file, the the program must must include the _____ _____ header file A. filestream.h B. fstream.h C. instream.h D. inoutstream.h E. iostream.h View Answer Workspace Report Discuss in Forum 44. A widget is to the blueprint for a widget as an object is to A. a member function B. a class C. an operator D. a data item View Answer Workspace Report Discuss in Forum 45. C++ allows you to define the same functions more than once in the same program _____  A. if the definitions are identical B. if the the def defin init itio ions ns are are inc inclu lude ded d in in tw two sep separ arat ate e #in #incl clud ude e fil files es C. if the the def defin init itio ions ns are are loc locat ated ed in in a sin singl gle e #inc #inclu lude de file file that that is is incl includ uded ed mor more e than than onc once e D. C++ C++ does does not not allo allow w you you to def defin ine e the the same same fun funct ctio ions ns mor more e than than onc once e in the the sam same e prog progra rama ma 46. Which of the following assigns the number 5 to the area variable? A. area 1 = 5 B. area = 5 C. area == 5 D. area --> 5 E. area < > 5 View Answer Workspace Report Discuss in Forum 47. A base class may also be called a A. child class B. subclass C. derived class D. parent class View Answer Workspace Report Discuss in Forum 48.  The _____ mode tells C++ to open open a file for input A. add::ios B. in::file C. ios::app D. ios::in E. ios::out View Answer Workspace Report Discuss in Forum 49. Using the wardrobe structure within the ShopList structure is an e xample of a good programming principle, known as _____  A. C.

reusability B. redundancy D.

polymorphism recursion

Section-II

1. When you omit parameters from a function call, values can be provided by A. formal parameters B. reference pa parameters C. overloaded parameters D. default parameters View Answer Workspace Report Discuss in Forum 2.  The first element in a string is A. the name of the string B. the first character in the string C. the length of the string D. the name of the array holding the str iin ng View Answer Workspace Report Discuss in Forum 3.

4

Variables declared outside a block are called _____  A. global B. universal C. stellar D. external View Answer Workspace Report Discuss in Forum 4.  The compiler converts converts your C++ C++ instructions into _____  A. edited code B. object code C. source code D. translated code View Answer Workspace Report Discuss in Forum 5. A fundamental type such as int or double is a _____  A. programmer-defined type B. complex type C. nonscalar type D. scalar type 6.  The return type you code for all constructors constructors is _____  A. void B. the class type C. the the sam same e type type as the the fir first st data data membe emberr def defin ined ed in the the cla class ss D. no type View Answer Workspace Report Discuss in Forum 7. When an object-oriented program detects an error within a function, the function _________  A. throws an exception B. throws a fit C. catches a message D. catches an exception View Answer Workspace Report Discuss in Forum 8. Using a statement at the wrong time or with an inappropriate object creates a A. logical error B. syntax error C. compiler error D. language error View Answer Workspace Report Discuss in Forum 9. When you create a derived class and instantiate an object _____  A. the the par pare ent clas lass obj objec ectt mus mustt be be con const strructe ucted d fir firsst B. the the chi chilld cla class ss object ject must ust be be co constr nstruc ucte ted d fir firsst C. the the par pare ent clas lass obj objec ectt mus mustt no not be be co constr nstruc ucte ted d D. the the chi chilld cla class ss object ject must ust not not be co constr nstruc ucte ted d View Answer Workspace Report Discuss in Forum 10. Evaluate the following expression: 4 >6 || 10 < 2 * 6 A. True B. 11. A constructor always has

False

A. communicational co cohesion B. temporal cohesion C. logical cohesion D. no cohesion View Answer Workspace Report Discuss in Forum 12. A normal C++ operator that acts in special ways on newly defined data types is said to be A. glorified B. encapsulated C. classified D. overloaded View Answer Workspace Report Discuss in Forum 13. A function in a derived class that has the same name as a function in the parent class A. will ov er er riride the base cl as ass function B. will cause an er ro ror messa ge ge to di sp splay C. will ill be over overri rid dden by the the base ase clas classs func unction ion D. will will exec execut ute e imme immedi diat atel ely y ofte often n the the base base clas classs func functi tion on exec execut utes es View Answer Workspace Report Discuss in Forum 14. In which statements, does a 'continue' statements cause the control to go directly to the test condition and then continue the looping process? A. 'for' and 'while' B. 'while' and 'if-else' C. 'do-while' and 'if-else' D. 'while' and 'do-while' E. None of the above View Answer Workspace Report Discuss in Forum 15. Which of the following statements is false? A. B. C. D. 16.

You You typi typica call lly y use use a publ public ic mem membe berr func functi tion on to to chan change ge the the val value ue in in a priv privat ate e data data mem membe berr Becau Because se the the cons constru truct ctor or funct function ion does does not not return return a value, value, you plac place e the the keywo keyword rd void void befo before re the the const construc ructo tor's r's nam name e The public public memb member er func functio tions ns in in a clas classs can can be access accessed ed by by any any progr program am that that uses uses an an objec objectt creat created ed from from that that class class An inst instan ancce of a clas lass is is cons consid ider ered ed an obje objecct

5

In a class specifier, data or functions designated private are accessible A. to any function in the program B. only if you know the password C. to member functions of that class D. only to pu public members of the cl class View Answer Workspace Report Discuss in Forum 17. When a function includes a throw statement for errors, the call to the potentially offending function should be placed within a _____ block A. throw B. try C. catch D. scope View Answer Workspace Report Discuss in Forum 18.  The scope resolution resolution operator is A. a comma B. a semicolon C. a colon D. two colons View Answer Workspace Report Discuss in Forum 19. "C++" is a _____ constant A. character literal B. named literal C. numeric literal D. string literal View Answer Workspace Report Discuss in Forum 20. In a C++ program, which of the following can be thrown? A. scalar variables B. programmer-defined objects C. both (a) and (b) D. neither (a) nor (b) 21.  The items listed in the function header header are called _____  A. actual arguments B. formal parameters C. passed parameters D. sent arguments View Answer Workspace Report Discuss in Forum 22. A translator that notes whether you have used a language correctly may be called a _____  A. theasurus B. compiler C. coder D. decoder View Answer Workspace Report Discuss in Forum 23.  The feature in object-oriented object-oriented programming programming that that allows the same same operation to be carried carried out differently, differently, depending on on the object, is_____  is_____  A. inheritance B. B. polymorphism C. overfunctioning D. overriding View Answer Workspace Report Discuss in Forum 24. When an argument is passed by r eference, A. a var varia iabl ble e is is cre creat ated ed in the the fun funct ctio ion n to hold hold the the argu argum ment' ent'ss val value ue B. the the fun funct ctio ion n ca cannot nnot acc access ess the the argum rgumen entt's valu value e C. a temp tempor orar ary y varia variabl ble e is crea create ted d in the the call callin ing g pro progr gram am to hol hold d the the argu argume ment nt's 's val value ue D. the the fun funct ctio ion n acce access sses es the the argu argume ment nt's 's orig origin inal al valu value e in in the the call callin ing g pro progr gram am E. None of the above View Answer Workspace Report Discuss in Forum 25.  The process of extracting the relevant relevant attributes of an object is known known as A. B. C. D.

polymorphism inheritance abstraction data hiding

26. Which of the following statements uses the computer's clock to initialize the random number generator? A. srand(time); B. srand(time(NULL)); C. time(srand); D. time(srand(NULL)); View Answer Workspace Report Discuss in Forum 27. A static data member is given a value A. within the class definition B. outside the class definition C. when the program is executed D. never View Answer Workspace Report Discuss in Forum 28.  You must provide a constructor constructor for a derived class class A. always B. if the base base clas lass co const nstruc ructor tor re requir quire ed arg argum umen entts C. if the the bas base e cla class ss cons constr truc ucto torr doe doess not not requ requir ired ed argu argume ment ntss D. never View Answer Workspace Report Discuss in Forum

6

29. If you want to override constructor default values for an object you are i nstantiating, you must also override A. all ot other pa parame te ters to to th that co constructor B. all parame te ters to the left of that val ue ue C. all parame te ters to th the riright of that va value D. no ot othe r parameters to th that co constr uc uctor View Answer Workspace Report Discuss in Forum 30.  To use one of the the C++ built-in mathematical mathematical functions, you you must include include the _____ header file file in your program A. calculation.h C. expression.h E. mathematical.h 31. Errors in a program are called

B. D.

compute.h math.h

A. accidents B. annoyances C. bugs D. mistakes E. typing errors View Answer Workspace Report Discuss in Forum 32. If you declare two objects as Customer firstCust, secondCust; secondCust; which of the following must be true? A. Each Each obje object ct's 's nons nonsta tati ticc dat data a mem membe bers rs will will be sto store red d in the the same same memo memory ry loc locat atio ion n B. Each Each obje object ct will ill be stor stored ed in the the sam same memor emory y loca locati tion on C. Each Each objec bjectt wil willl have have a uni uniqu que e memory add addres ress D. You cann annot decla eclare re two two obj objec ects ts of the sam same cla class ss View Answer Workspace Report Discuss in Forum 33. Which of the following is the inequality operator? A. != B. = C. == D. --> E. View Answer Workspace Report Discuss in Forum 34. If a derived class uses the public access specifier, then _____  A. publ public ic base base clas classs mem membe bers rs rem remain ain pub publi licc in in the the deri derive ved d cla class ss B. prot protec ecte ted d bas base e cla class ss membe embers rs bec become ome publ public ic in the the der deriv ived ed clas classs C. both (a) and (b) D. neither (a) nor (b) View Answer Workspace Report Discuss in Forum 35.  The operator that releases releases previously allocated allocated memory memory is _____  A. C.

release delete

B. D.

return destroy

36. When a language has the capability to produce new data types, it is said to be A. reprehensible B. encapsulated C. overloaded D. D. extensible View Answer Workspace Report Discuss in Forum 37. A compound statement does not consist of  A. a single statement B. other compound statements C. expression statements D. control statements E. None of the above View Answer Workspace Report Discuss in Forum 38. Which of the following statements will display the word "Hello" on the computer screen? A. cin > "Hello"; C. cout > "Hello"; E. None of the above View Answer Workspace Report Discuss in Forum 39.  The preprocessor directive always always starts with the symbol A. % B. & C. # D. "" E. None of the above View Answer Workspace Report Discuss in Forum 40. Which of the following statements is true? A. B. C. D.

Data Data coup coupli ling ng is tigh tighte terr than than path pathol olog ogic ical al coup coupli ling ng Common couplin pling g is loo looser than than data data coup coupli ling ng Data Data-s -str truc uctu ture red d cou coupl plin ing g is is lo looser oser than than cont contro roll cou coupl plin ing g Contro ntroll cou coupl plin ing g is loose ooserr tha than n da data coupli upling ng

41. Evaluate the following expression: 7 >=3 + 4 || 6= 0); E. while (age >= 0) View Answer Workspace Report Discuss in Forum 44.  The most efficient efficient data type for for a variable that stores stores the number 4.6e20 is the _____ _____ data type A. Character B. Double C. Float D. Long Integer E. Short Integer View Answer Workspace Report Discuss in Forum 45. Which of the following is a C++ object? A. C.

cin iostream

B. D.

>> read()

46. Which of the following can be used to declare the main function? A. void main B. void Main() C. void main() D. main E. either (b) or (c) can be used View Answer Workspace Report Discuss in Forum 47.  You _____ write your own container container classes A. must B. may C. should not D. must not View Answer Workspace Report Discuss in Forum 48. If an integer object is thrown with a throw statement, then a subsequent catch block has a usable match if the type of the catch argument is A. int B. double C. either (a) or (b) D. neither (a) nor (b) View Answer Workspace Report Discuss in Forum 49.  The highest level of of cohesion is A. functional cohesion B. temporal cohesion C. logical cohesion D. sequential cohesion View Answer Workspace Report Discuss in Forum 50.  You separate a derived derived class name name from its access access specifier specifier with A. B. C. D.

a colon two colons at least one space a semicolon

Section-III 1.  The last statement statement in a function is often a(n) _____  _____  A. return B. goodbye C. finish D. endfunction View Answer Workspace Report Discuss in Forum 2. When the function int someFunction(char c) throw( ) is executed, _____  A. it can throw anything B. it may throw an integer C. it may throw a character D. it may not throw anything View Answer Workspace Report Discuss in Forum 3.  The two statements statements that can be be used to change the flow of control control are A.

if and switch

8

B. if and while C. switch and do-while D. break and continue E. None of the above View Answer Workspace Report Discuss in Forum 4. If p and q are assigned the values 2 and 3 respectively then the statement P = q++ A. gives an error message B. assigns a value 4 to p C. assigns a value 3 to p D. assigns a value 5 to p E. None of the above View Answer Workspace Report Discuss in Forum 5. Which of the following is the insertion operator? A. >> B. > B. read() C. cin D. iostream View Answer Workspace Report Discuss in Forum 45. Precedence determines which operator A. B. C. D. E.

is evaluated first is most important is fastest operates on the largest number None of the above

46. When using the standard files that come with the C++ compiler, you should surround the header file name with _____  A. square brackets B. angle brackets C. parentheses D. quotes View Answer Workspace Report Discuss in Forum 47.  The loop condition condition in a flowchart flowchart is represented by a(n) _____  A. diamond B. ov a l C. parallelogram D. rectangle View Answer Workspace Report Discuss in Forum 48. Which of the following, if any, are invalid names for a variable? A. bankAccountNumber B. first_Name C. doubleNumber D. operator E. All of the the abov above e are are vali valid d names ames for for va variab riable less View Answer Workspace Report Discuss in Forum 49. Inheritance is the principle that A. B. C. D.

clas classe sess wit with h the the same same nam name mus mustt be be der deriv ived ed from rom one one anot anothe herr know knowle ledg dge e of of a gene genera rall cat categ egor ory y can can be appl applie ied d to to mor more e spe speci cifi ficc obj objec ects ts C++ C++ fun funct ctio ions ns may may be be use used d onl only y if they they have have logi logica call pre prede dece cess ssor orss one func functi tion on nam name may may invo invoke ke dif differen erentt met metho hods ds

Section –IV

1.  You typically initialize a String variable to _____  A. an asterisk B. a space enclosed in single quotes C. the number 0 D. a zero-length string View Answer Workspace Report Discuss in Forum 2.  The set of instructions instructions for how to tie a bow is an example of the _____ structure structure A. control B. repetition C. selection D. sequence E. switching View Answer Workspace Report Discuss in Forum 3.

12

If no exception is thrown ________  A. a catch block will cause an error B. the fifi rs rst catch bl oc ock coded will ex ex ec ecute C. the last catch block coded with ex ec ecute D. any catch bl oc ocks coded wi th th be bypa ss ssed View Answer Workspace Report Discuss in Forum 4. A program that predicts the exact sequence in which events will take place is said to be ________  A. compiled B. interpreted C. procedural D. object-oriented View Answer Workspace Report Discuss in Forum 5. A blueprint for creating an object in C++ is called _____  A. B. C. D. E.

a class an instance a map a pattern a sketch

6.  The prototype for for a derived class constructor constructor may may include arguments arguments for A. data members of the derived class B. data members of the base class C. both (a) and (b) D. neither (a) nor (b) View Answer Workspace Report Discuss in Forum 7. Overloading involves writing two or more functions with ________  A. dif differen erentt na names and and dif differen erentt arg argum ume ent list listss B. different na names an and th the sa sa me me ar argument lili st st C. the sa sa me me na name an and di different ar argument lilists D. the sa sa me me name and the same a rg rgument li st st View Answer Workspace Report Discuss in Forum 8.  You___________overload  You___________overload function templates A. may, as long long as eac each ver versi sion on has has the the sam same arg argum umen entts B. may, may, as long long as eac each vers versio ion n has has diff differ eren entt argu argum ments ents C. must D. must not View Answer Workspace Report Discuss in Forum 9.  You typically initialize Character variables variables to _____  A. a space enclosed in double quotes B. a space enclosed in single quotes C. the letter O D. the number 0 E. the value false View Answer Workspace Report Discuss in Forum 10. One way pointers are useful is to refer to a memory address that has no _____  A. name B. constant C. location D. field 11. A member function uses the correct object when you call it because A. a copy of the objec bjectt is pass passed ed to the the func unctio tion B. the the add addre resss of of the the obje objecct is is pas passe sed d to to the the func functtion ion C. the the add addre ress ss of the the fun funct ctio ion n is is pas passe sed d to anot anothe herr fun funct ctio ion n D. the the add addre ress ss of the the obje object ct is retu return rned ed fro from the the fun funcction tion View Answer Workspace Report Discuss in Forum 12.  Two access specifiers in C++ are A. public and private B. int and double C. formal and informal D. void and free View Answer Workspace Report Discuss in Forum 13. Which of the following is the fourth problem-solving step? A. analyze the problem B. eva evaluat luate e and and modif dify (if (if neces ecessa sarry) the prog rogram ram C. code the algorithm D. plan the algorithm E. desk-check the program View Answer Workspace Report Discuss in Forum 14. Within parentheses, catch blocks can have _____  A. no arguments B. one argument C. two arguments D. as many arguments as necessary View Answer Workspace Report Discuss in Forum 15.  The while loop is referred to as a(n) a(n) _____ loop because because the loop condition condition is tested at the the beginning of the loop

13

A. beginning B. initial C. pretest D. priming 16.  The word case case used in the switch switch statement statement represents a A. function in the C++ language B. data type in the C++ language C. keyword in the C++ language D. global variable in the C++ language E. None of the above View Answer Workspace Report Discuss in Forum 17. Function templates _____________  A. must ha have ex exactly on one pa parameter B. may may hav have e mor more e tha than n one one para parame mete terr as as lon long g as as the they y are are of the the sam same e typ type e C. may hav have more than han one param arame eter ter of any type type D. may not have parameters View Answer Workspace Report Discuss in Forum 18.  The statement int num[2][3]={ {3,8,6}, {3,8,6}, {9,4,7}}; A. assigns a value 4 to num[1][2] B. assigns a value 7 to num[1][2] C. assigns a value 8 to num[1][2] D. assigns a value 9 to num[1][2] View Answer Workspace Report Discuss in Forum 19. Private data can be accessed by A. class member functions B. functions in derived classes C. both (a) and (b) D. neither (a) nor (b) View Answer Workspace Report Discuss in Forum 20.  The store of memory memory available to programs is the _____  A. C.

store p ile

B. D.

stack heap

21.  The most common common operation operation used in constructors constructors is _____  _____  A. addition B. overloading C. assignment D. polymorphism View Answer Workspace Report Discuss in Forum 22. When a function performs tasks based on a decision, it has _____  A. functional cohesion B. coincidental cohesion C. logical cohesion D. no cohesion View Answer Workspace Report Discuss in Forum 23.  To create a template template class, you begin with _________  _________  A. the template definition B. the keyword class C. the function definitions D. the keyword definition View Answer Workspace Report Discuss in Forum 24. Which of the following is a C++ object? A. >> B. read() C. cin D. iostream View Answer Workspace Report Discuss in Forum 25. A variable is _____  A. B. C.

an item of data a mem memor ory y loc locat atio ion n who whose se valu value e can can chan change ge whil while e the the prog progra ram m is runn runnin ing g a mem memor ory y loc locat atio ion n who whose se valu value e can canno nott cha chang nge e whi while le the the pro progr gram am is runn runnin ing g

31.  To send output to a file, you need to to include the _____ _____ header file in your program A. file.h B. fstream.h C. iomanip.h D. iostream.h E. of stream.h View Answer Workspace Report Discuss in Forum 32. A C++ _____ is a program that runs in a DOS window A. algorithm B. cast application C. console application D. source application View Answer Workspace Report Discuss in Forum 33.

14

A difference, between reference variables and pointers is that A. reference variable s ar e easier to use B. pointers are easier to use C. reference variable s ar e mor e flexible D. no dif diffe fere renc nce e exis exists ts bet betwe ween en refe refere renc nce e vari variab able less and and poi point nter erss View Answer Workspace Report Discuss in Forum 34. A 'C function does not contain A. a function header B. argument declarations C. other 'C' functions D. function body E. None of the above View Answer Workspace Report Discuss in Forum 35.  _____ variables remain remain in memory memory until the program ends A. Area B. Global C. Local D. Reference E. Value 36.  The outline or the definition definition of a function function is called its A. beta test B. forerunner C. outline D. prototype View Answer Workspace Report Discuss in Forum 37. Which of the following is false? A. Data Data stor stored ed in an arra array y can can be acce access ssed ed fast faster er than than data data stor stored ed in a dis diskk fil file e B. Data Data stor stored ed in an an arra array y need needss to to be be ente entered red only only once once,, typi typica cally lly at the the beginn beginning ing of the progra program m C. Arra Arrays ys allo allow w the the prog progra ramm mmer er to to stor store e info inform rmat atio ion n in the the com compu pute ter's r's inte intern rnal al mem memor ory y D. When When usin using g arra arrays ys,, you you wil willl have have fewe fewerr varia variabl ble e nam names es to reme rememb mber er E. None of of th the pr preceding st statements ar are fa false View Answer Workspace Report Discuss in Forum 38. A function stub typically contains A. the function header B. the function braces C. the the ret retur urn n stat statem emen ent, t, if it's it's valu valuee- retu return rnin ing g func functi tion on D. a display message E. All of the above View Answer Workspace Report Discuss in Forum 39. A variable's _____ indicates which portions of the program can use the variable A. area B. extent C. lifetime D. reach E. scope View Answer Workspace Report Discuss in Forum 40. If an integer object is thrown with a throw statement, then a subsequent catch block has a usable match if the type of the catch argument is  _____  A. B. C. D.

const int & int & either (a) or (b) neither (a) nor (b)

41.  _____ variables are declared outside of any statement statement block A. Area B. Global C. Local D. Reference E. Value View Answer Workspace Report Discuss in Forum 42.  The end of string is is recognized by A. the null character B. the newline character C. the $ sign D. the / sign E. None of the above View Answer Workspace Report Discuss in Forum 43. Variable names known only to the procedure in which they are declared are ________  A. local B. global C. recent D. internal View Answer Workspace Report Discuss in Forum 44.  The strcpy(empName[0], strcpy(empName[0], empName[2]); empName[2]); statement statement will A. replace the le letter M with the le letter r B. replace the le letter M with the le letter J C. replace the letter M wi th tht he letters S D. replace the name M ar ary wi th th the name Sue E. replace the name Sue wi th th the name Mary View Answer Workspace Report Discuss in Forum

15

45. Whis is true? A. B. C. D.

A deri derive ved d cla classs may may have ave mo more than han one one bas base cl class ass A base base clas classs may have have more than han one one deri derive ved d clas classs both (a) and (b) neither (a) nor (b)

46.  The keyword used used to define a structure structure is A. stru B. stt C. struct D. unlimited View Answer Workspace Report Discuss in Forum 47. If you omit any constructor constructor argument when you instantiate an object, you must use default values A. for al l parameter s to the constructor B. for all all para param mete eters to the the righ rightt of the the arg argu ument ent C. for all all para param mete eters to the the lef left of the the arg argu ument ent D. for no other parameters View Answer Workspace Report Discuss in Forum 48.  The C++ expression p --> val means means the same thing thing as A. *p.val B. *(p.val) C. (*p).vai D. p.val View Answer Workspace Report Discuss in Forum 49. Which of the following tells C++ to display numbers with zero decimal places? A. setiosflags(0) B. setiosflags(zero) C. setprecision(0) D. setprecision(zero) View Answer Workspace Report Discuss in Forum 50. Code that has already been tested is said to be _____  A. C.

inherited reliable

B. D.

reusable polymorphic

Section-V

1. If no constructors can specified for a derived class, objects of the derived class will use the constructors constructors in the base class A. True B. False View Answer Workspace Report Discuss in Forum 2.  The get() function function returns _____  A. a character B. void C. a reference to the object th that i nv nv ok oke d it D. a copy of the object that invoked it View Answer Workspace Report Discuss in Forum 3.  The most efficient efficient data type for for a variable that the the number 20000 is the _____ data type type A. Character B. Double C. Float D. Long Integer E. Short Integer View Answer Workspace Report Discuss in Forum 4.  The number 5.5e3 5.5e3 is a _____ constant constant A. character literal B. named literal C. numeric literal D. string literal View Answer Workspace Report Discuss in Forum 5.  The compiler determines determines the type type used in a template template function via via ___________  A. the name of the function B. the the fir first st vari varia able ble dec decla lare red d wit with hin the the fun funcctio tion C. the the typ type e of of the the arg argu ument ent pass assed to th the fun funcctio tion D. the the typ type e of of th the val valu ue ret retur urne ned d fro from m the func unction tion 6. Simple routines that programmers use as place holders while a system is being tested are called _____  A. stubs B. stumps C. holders D. templates View Answer Workspace Report Discuss in Forum 7.  You can place function templates templates A. at the end of main() B. at th the st start of of a pr program above ma main() C. in two two fil files es-o -one ne for the the def defin init itio ion n and and one one for for the the fun funct ctio ion n D. any of the above View Answer Workspace Report Discuss in Forum

16

8.  The two operators operators && an || are A. arithmetic operators B. equality operators C. logical operators D. relational op operators E. None of the above View Answer Workspace Report Discuss in Forum 9.  The arguments that determine the the state of the cout cout object are called called _____  A. classes B. manipulators C. format flags D. state co controllers View Answer Workspace Report Discuss in Forum 10. Static variables are sometimes called A. class variables B. functional variables C. dynamic variables D. auto variables 11.  The variables declared declared in a statement statement block or listed listed in a function function header's parameterlist parameterlist are considered considered _____ variables A. area B. global C. local D. reference E. value View Answer Workspace Report Discuss in Forum 12. An expression A. is a colle collect ctio ion n of data data obje object ctss and and oper operat ator orss that that can can be eva evalu luat ated ed to to a sin singl gle e valu value e B. is a nam name that that subs substi titu tute tess for for a sequ sequen ence ce of chara haract cter erss C. caus auses the the computer uter to carr carry y out some ome acti actio on D. All of the above E. None of the above View Answer Workspace Report Discuss in Forum 13. In the C language, the character type of constant is delimited by using A. single quotes B. double quotes C. parenthesis D. # E. None of the above View Answer Workspace Report Discuss in Forum 14. One way in which a structure differs from an array is that _____  A. a st struc ructur ture ma may hav have e mem membe bers rs of mor more e th than one type ype B. a str struc uctu ture re must ust hav have e mem membe bers rs that that;; are are all all the the same same type type C. art art arra array y may ha have membe embers rs of more than han one type type D. ther there e is no diff differ eren encce bet betwe ween en a stru struct ctur ure e and and an arra array y View Answer Workspace Report Discuss in Forum 15. A default constructor _____  A. B. C. D.

takes no arguments has defaul t v al alue s for al al l its arguments either (a) or (b) neither (a) nor (b).

16.  The number 125.35 125.35 is a _____  A. character literal constant B. numeric literal constant C. string literal constant D. variable View Answer Workspace Report Discuss in Forum 17. When a class serves as a base class to others, _____  A. all of itits members are inherited B. all all of of its its mem membe bers rs are are inhe inheri rite ted, d, exc except ept for for any any pri priva vate te membe embers rs C. all all of of its its mem membe bers rs are are inhe inheri rite ted, d, exc excep eptt for for any any pro prote teccted ted mem membe bers rs D. None None of its its mem membe bers rs is inhe inheri rite ted d unl unles esss spe speccific ifical ally ly "lis "liste ted d View Answer Workspace Report Discuss in Forum 18. Storing a class definition in a separate file is an example of  A. polymorphism B. name mangling C. implementation hiding D. inheritance View Answer Workspace Report Discuss in Forum 19. Which is true? A. B. C.

Sequ Sequen enti tial al cohe cohesi sion on is slig slight htly ly weak weaker er than than func functi tion onal al cohe cohesi sion on Sequ Sequen enti tial al cohe cohesi sion on is slig slight htly ly stro strong nger er than than func functi tion onal al cohe cohesi sion on Sequ Sequen enti tial al cohe cohesi sion on is is muc much h str stron onge gerr than than fun funct ctio iona nall cohe cohesi sion on

17

D. Neit Neithe herr sequ sequen enti tial al cohe cohesi sion on nor nor func functi tion onal al coh cohes esio ion n is stro strong nger er tha than n the the othe otherr View Answer Workspace Report Discuss in Forum 20. A class named student must have a constructor whose name is A. B. C. D.

student ~student constructor any legal C++ name.

21.  The statement double double val[15]={44.123456}; val[15]={44.123456}; A. assi assign gnss the the valu value e 44. 44.12 1234 3456 56 to all all mem membe bers rs of the the arr array ay val val B. assi assign gnss the the valu value e 44. 44.12 1234 3456 56 to val[ val[0] 0] and and 0 to the the res restt of of the the memb member erss C. gives an error message D. assi assign gnss the the valu value e 44. 44.12 123 345 to val[1 al[1]] an and va val[5 l[5] View Answer Workspace Report Discuss in Forum 22. Which of the following C++ expressions will find the square root of the number 16? A. pow (16, 2) (b) root (16, 2) B. sqroot (16) C. sqrt (16, 2) D. sqrt (16) View Answer Workspace Report Discuss in Forum 23. Which of the following does not have an unary operator ? A. 7 B. ++i C. j D. All of the above E. None of the above View Answer Workspace Report Discuss in Forum 24. It is illegal to make objects of one class members of another class A. True B. False C. depends upon the kind of object View Answer Workspace Report Discuss in Forum 25. Catch blocks must _____  A. B. C. D.

appear in in e ve very ob object-or iie e nt nted pr program appear within try blocks appe appea ar imm immediate iately ly after fter throw hrow stat statem emen ents ts appear i mm mmediately after tr y blocks

26. An exception specification begins with the keyword _____  A. exception B. try C. throw D. catch View Answer Workspace Report Discuss in Forum 27.  You construct construct a class in two two sections, known known as the _____  _____  A. header and body B. type and parameters C. declaration and implementation D. pointer and variable View Answer Workspace Report Discuss in Forum 28. It is sometimes useful to specify a class from which no objects will ever be created A. True B. False View Answer Workspace Report Discuss in Forum 29.  The statement i*=3 i*=3 is equivalent to A. i = 3* B. i=3 C. i* = 3 D. i=i*3 E. None of the above View Answer Workspace Report Discuss in Forum 30.  The complement complement operator is represented represented by the symbol symbol A. B. C. D. E.

~ ^ i < None of the above

31. One of the relational operators in the C language is A. B. C. D. E.

!= && ! # None of the above

18

View Answer Workspace Report Discuss in Forum 32. Within a program, you can instantiate ________that have a class template type A. classes B. functions C. parameters D. objects View Answer Workspace Report Discuss in Forum 33.  The rules to any programming programming language are its _______  A. syntax B. interpretation C. logic D. customs View Answer Workspace Report Discuss in Forum 34. Which of the following backslash codes used for bell? A. \b B. a C. \r D. \s E. None of the above View Answer Workspace Report Discuss in Forum 35.  The last statement statement in a value-returning function is always _____  A. B. C. D.

}; result expression; return; return expression;

36. One of the logical operators in the C language is represented by the symbol A. AND B. && C. >= D. > B. & C. * D. ! View Answer Workspace Report Discuss in Forum 43. Which of the following is false? A. A poi point nter er vari variab able le conta ontain inss the the addr addres esss of of a var varia iabl ble e in in mem memor ory y B. You You sho shoul uld d bot both h dec decla lare re and and ini initi tial aliz ize e a poi point nter er bef befo ore you you use use it C. Poin Pointe ters rs are are typ typic ical ally ly init initia iali lize zed d to to the the empt empty y str strin ing g ("" ("")) D. A poi point nter er's 's data dataty type pe must must matc match h the the data dataty type pe of the the vari variab able le to whic which h it it poi point ntss E. A poi point nter er vari variab able le is typi typica call lly y ref refer erre red d to to sim simpl ply y as as a poin pointe terr View Answer Workspace Report Discuss in Forum

19

44.  The function that that takes arguments arguments to set the bits of cout is _____  _____  A. setf() B. bitset() C. ios() D. flat() View Answer Workspace Report Discuss in Forum 45. When you declare a pointer, you must give it a _____  A. type B. type and name C. type, name, and value D. name and value 46.  You typically initialize Short Integer, Integer, Integer, and Long Integer Integer variables to A. a space enclosed in double quotes B. a space enclosed in single quotes C. the letter O D. the number 0 E. the value false View Answer Workspace Report Discuss in Forum 47. Assume that a variable will need to store only integers in the range of 1 through 20000. The most efficient data type for the variable is _____  A. character B. float C. integer D. long integer E. short integer View Answer Workspace Report Discuss in Forum 48. Which of the following is true? A. B. C. D.

iostream is derived from istream iostream is derived from ostream ostream is derived from iostream ostream is derived from istream

Unit VI 1. Which of the following are valid characters for a numeric literal constant? A. a decimal point B. the letter e C. a minus sign D. a plus sign E. All of the above View Answer Workspace Report Discuss in Forum 2. Any #include files may contain A. constants B. variables C. functions D. All of the above View Answer Workspace Report Discuss in Forum 3. When a break statement is used in a loop, the control skips the rest of the statements in the loop a fter it and jumps A. to the last lines in the program B. to the the nex nextt stat statem emen entt writt ritten en afte afterr the the body body of the the loo loop p C. to th the fifir sstt st state me ment in in th the bo body of of th the lo loop D. All. of the above E. None of the above View Answer Workspace Report Discuss in Forum 4.  The function that that takes arguments arguments to set the bits of count is _____  _____  A. setf() B. bitsef() C. ios() D. flag() View Answer Workspace Report Discuss in Forum 5. When two types are used in a function template and one is labeled T, the other A. must also be named T B. must be named U C. can be any legal C++ identfier D. it is illegal to have two types 6.  The best-written classes classes have A. all functions private B. all data public C. no functions D. None of the above View Answer Workspace Report Discuss in Forum 7. Making class members inaccessible to nonmember functions is an example of  A. B. C. D.

polymorphism data hiding redundancy recursion

20

View Answer Workspace Report Discuss in Forum 8. Providing two or more constructors for the same class _____  A. requires different ar argument lists B. require s different constructor names C. require s different constructor types D. is illegal View Answer Workspace Report Discuss in Forum 9. '3' is a _____ constant A. character literal B. named literal C. numeric literal D. string literal View Answer Workspace Report Discuss in Forum 10.  _____ variables remain remain in memory memory until the statement statement block ends A. Area B. Global C. Local D. Reference E. Value 11. An address is a _____ , while a pointer is a _____  A. array, variable B. constant, variable C. variable, position D. variable, location View Answer Workspace Report Discuss in Forum 12. Procedural cohesion is similar to sequential cohesion, except that with procedural cohesion _____  A. the tasks are not done in order B. the tasks are simpler C. the tasks share data D. the tasks do not share data View Answer Workspace Report Discuss in Forum 13. Which of the following creates an animal object named dog? A. animal "dog"; B. animal dog; C. dog "animal"; D. dog animal; View Answer Workspace Report Discuss in Forum 14.  The getline() function function reads a line of of text until _____  A. the the len lengt gth h use used d as as the the seco econd argu argum ment ent is is rea reacched hed B. the the cha chara raccter used used as the the th third ird ar argum gument is reac reache hed d C. either (a) or (b) D. neither (a) nor (b) View Answer Workspace Report Discuss in Forum 15.  The extraction operator operator >> is a(n) A. overloaded function B. C++ class C. C++ object D. static reference variable 16. One drawback to returning an error code from a function is _____  A. functions cannot return error codes B. erro errorr cod codes es must must be inte intege gers rs,, and and some some func functi tion onss can can't 't retu return rn an inte intege gerr C. a fun funct ctio ion n can can retu return rn only only one one val value ue,, so so it it can can retu return rn only only the the err error or code code D. a fun funct ctio ion n tha thatt ret retur urns ns an erro errorr cod code e wil willl ide ident ntif ify y all all retu return rnss as as err error orss View Answer Workspace Report Discuss in Forum 17. Assuming the following three operators appear in an expression (without parentheses), which of the operators will be performed first? A. && B. ! C. || D. [NIL] View Answer Workspace Report Discuss in Forum 18.  The code that you you enter into a C++ C++ program is called called _____  A. console code B. object code C. project code D. source code View Answer Workspace Report Discuss in Forum 19. If a base class member is private, then A. if a der deriv ived ed cla class ss use usess the the publ public ic acc acces esss spe speci cifi fier er,, the the data data mem membe berr beco become mess publ public ic B. if a deri derived ved class class uses uses the the protec protected ted access access specif specifier ier,, the the data data mem member ber becom becomes es protec protected ted C. both (a) and (b) D. neither (a) nor (b) View Answer Workspace Report Discuss in Forum 20. Which of the following instructions tells C++ to merge the source code from the iostream.h file into the current file?

21

A. B. C. D. E.

#include #include iostream.h #include #merge iostream.h None of the above

21.  The statement double double total = 0.0; performs performs _____  _____  A. assignment B. B. initialization C. rationalization D. polymorphism View Answer Workspace Report Discuss in Forum 22.  The two parts of a function are the A. header and footer B. declarations and statements C. legs and feet D. header and body View Answer Workspace Report Discuss in Forum 23.  The general principle principle underlying object-oriented object-oriented error handling handling is that a called function function should __________  __________  A. neither ch check fo for, no nor ha handle er errors B. chec checkk for for erro errors rs but but not not be requ requir ired ed to hand handle le any any det detec ecte ted d C. handle er errors, bu but no not ch check for th them D. both check for and handle errors View Answer Workspace Report Discuss in Forum 24. Which of the following is false? A. A void void func functi tion on's 's head header er begi begins ns with with the the keyw keywor ord d void void B. A value value-re -retur turnin ning g funct function ion's 's heade headerr begin beginss with with a data data type type,, which which repres represent entss the the type type of data data the func functio tion n will will retur return n C. Assum Assuming ing disp display layAge Age is is the name name of a void void funct function ion,, displa displayAg yAge() e();; is a both both logic logicall ally y and synt syntact actica ically lly vali valid d C++ stat statem ement ent D. Assuming Assuming calcNewP calcNewPrice rice is the the name name of a value-retu value-returning rning function, function, calcNewP calcNewPrice riceO; O; is a both logically logically and syntactic syntactically ally valid C++ statement E. Both Both voi void d and and val value ue-r -ret etur urni ning ng func functi tion onss can can rec recei eive ve argu argum ments ents.. View Answer Workspace Report Discuss in Forum 25. Reference variables and const class member A. must be assi assign gned ed valu value es in any deriv erived ed class lass B. must never be initializ ed ed in a base cla ss ss C. must be init initia iali lize zed d, rat rathe herr th than assig ssign ned valu values es D. must no not ex exit ifif a cl as ass i s to be be a base cl cla ss ss 26.  The actual arguments arguments cannot he A. a constant or a variable B. of a dif diffe fere rent nt type type from from the the co corres rrespo pond ndin ing g for forma mall arg argum umen ents ts C. other functions D. expressions E. None of the above View Answer Workspace Report Discuss in Forum 27.  The function stricmp("Jos stricmp("Jose", e", "JOSE") will return _____  _____  A. -1 B. 0 C. 1 View Answer Workspace Report Discuss in Forum 28. Which is true? A. Coin Coinci cide dent ntal al cohe cohesi sion on is stro strong nger er than than proc proced edur ural al cohe cohesi sion on B. Logi Logica call coh cohes esio ion n is is str stron onge gerr tha than n coi coinc ncid iden enta tall coh cohes esio ion n C. Sequ Sequen enti tial al cohe cohesi sion on is weak weaker er than than temp tempor oral al cohe cohesi sion on D. The we weakest co cohesion is is fu functional View Answer Workspace Report Discuss in Forum 29. A predefined function that may be used to handle memory allocation errors is A. handle_error B. set_new_handler C. new_fix D. memory_error View Answer Workspace Report Discuss in Forum 30. A function in a derived class that has the same name as a function in the parent class _____  A. will cause an er ro ror messa ge ge to di sp splay B. will ov er er riride the base cl as ass function C. will ill be over overri rid dden by the the base ase clas classs func unction ion D. will will exec execut ute e imme immedi diat atel ely y afte afterr the the bas base e clas classs func functi tion on exec execut utes es 31.  The _____ function function returns the uppercase uppercase equivalent equivalent of a character character A. caseupper B. charupper C. toupper D. uCase E. upper View Answer Workspace Report Discuss in Forum 32. When you instantiate a derived class object, a constructor for the derived class _____  A. B. C.

is not called is calle alled d prior rior to the the base base clas lass const onstru rucctor tor is call called ed sim simulta ultane neou ousl sly y wit with h the the base base clas classs con const stru ruct ctor or

22

D. None of the above View Answer Workspace Report Discuss in Forum 33. A constructor may be _____  A. provided automatically by C++ B. written by you C. either (a) or (b). D. neither (a) nor (b). View Answer Workspace Report Discuss in Forum 34. Software that can be used in applications other than the one for which it was originally written is called A. recyclable B. inherited C. reusable D. cheating View Answer Workspace Report Discuss in Forum 35. Which of the following statements is false? A. A cla class ss enca encaps psul ulat ates es all all of of an an obj objec ect' t'ss att attri ribu bute tess and and beha behavi vior orss B. An exam exampl ple e of of an an att attri ribu bute te is the the min minut utes es vari variab able le in a tim time e cla class ss C. An exam exampl ple e of of a beh behav avio iorr is is the the setT setTim ime e fun funct ctio ion n in in a tim time cla class ss D. A class is considered an an object E. An obje object ct crea create ted d fro from m a cla class ss is refe referr rred ed to as an inst instan ance ce of the the clas classs 36.  Typing the function's function's name as Main, rather than main, is an example example of  A. an entry error B. a function error C. a logic error D. a syntax error View Answer Workspace Report Discuss in Forum 37. When the compiler cannot differentiate between two overloaded constructors, constructors, they are called______  A. overloaded B. B. destructed C. ambiguous D. D. dubious View Answer Workspace Report Discuss in Forum 38. A function argument is A. a var varia iabl ble e in in the the func functi tion on that that rece receiv ives es a val value ue from from the the cal calli ling ng prog progra ram m B. a way way tha thatt fun funct ctio ions ns resi resist st acce accept ptin ing g the the cal calli ling ng prog progra ram' m'ss valu values es C. a val valu ue sen sentt to to the the func functi tion on by the the calli allin ng pr progra ogram m D. a valu value e retu return rned ed by the the fun funct ctio ion n to to the the cal calli ling ng prog progra ram m E. None of the above View Answer Workspace Report Discuss in Forum 39. A function that is prototyped as double calculate(int num); may______  A. receive an an in integer co constant su such as as 5 B. receive an integer variable C. either (a) or (b) D. neither (a) nor (b) View Answer Workspace Report Discuss in Forum 40. Passing a variable pointer as a constant _____  A. prot protec ects ts the the con conte tent ntss poi point nted ed to by the the poi point nter er from from chan change ge B. elim elimin inat ates es the the nee need d to name name the the poin pointe terr in in the the fun funcction tion C. elim elimin inat ates es the the nee need d to to giv give e the the poin pointe terr a type type in the the fun funcction tion D. caus causes es a cop copy y of of the the poin pointe terr to to be be pro produ ducced in the the fun funct ctio ion n 41. Recursive Functions A. easier to code B. executable faster than iter at ative one s C. takes less main storage space D. nece necess ssar ary y to solv solve e a certa ertain in clas classs of pro problem blemss E. None of the above View Answer Workspace Report Discuss in Forum 42.  The purpose of a conditional operator operator is to A. select one of the two values B. select the hi highest of the two values C. sele select ct one of the the tw two va values lues depe depen ndin ding on on a co condit nditio ion n D. sel ec ect the more e qu qual of the two values E. None of the above View Answer Workspace Report Discuss in Forum 43. Which of the following, if any, are valid names for variables? A. amt.Sold B. amt-Sold C. amt_Sold D. 98Sold E. None None of the abo above are are vali valid d nam names es for var variiable abless View Answer Workspace Report Discuss in Forum 44. Assume you want to compare the character stored in the initial variable to the letter a. Which of the following conditions should you use in the if  statement? (Be sure the condition will handle a or A.) A. B.

(initial = 'a' or 'A') (initial == 'a' or 'A')

23

C. (toupper(initial) = 'A') D. (toupper(initial) == 'A') View Answer Workspace Report Discuss in Forum 45.  You can override a class's inherited access to make make an individual individual member's access more more ______  A. liberal B. conservative C. either (a) or (b) D. neither (a) nor (b) 46. A class hierarchy A. describe s "is a kind of" relationshi ps ps B. describes "has a" relationships C. show showss the the sam same e rela relati tion onsh ship ipss as an orga organi niza zati tion on chart hart D. sho shows the the sam same e rela relati tion onsh ship ipss as a fami amily tree tree View Answer Workspace Report Discuss in Forum 47. Which of the following C++ expressions is equivalent to the mathematical expression 53 ? A. 5^3 B. cube(5) C. pow (3, 5) D. pow(5, 3) E. sqrt (5, 3) View Answer Workspace Report Discuss in Forum 48.  The right shift operator operator is represented by the symbol A. > B. >> C. -> D. < E. None of the above View Answer Workspace Report Discuss in Forum 49. In C++, class definitions are most often A. B. C. D.

stor e ed d with ea ch ch progr am am that uses them stor stored ed in a hea heade derr file file that that is incl includ uded ed in the the pro progr gram amss that that use use the them m sto stored red in in a fold folder er that that you you past paste e int into o ever every y new new proj projec ectt retyped for every new project

Section VII

1.  The comma comma operator (,) is primarily primarily used in conjunction conjunction with with A. 'for' statement B. 'if-else' statement C. 'do-while' st statement D. All of the above E. None of the above View Answer Workspace Report Discuss in Forum 2.  To execute a C++ C++ program, you you first need to translate translate the source code into object object code. This process process is called A. coding B. compiling C. sourcing D. translating View Answer Workspace Report Discuss in Forum 3.  The rules of a programming programming language are called called its _____  A. code B. guidelines C. procedures D. D. regulations E. syntax View Answer Workspace Report Discuss in Forum 4. An array element is accessed using A. a fifirst-in-first-out ap approach B. the dot operator C. a member name D. an index number View Answer Workspace Report Discuss in Forum 5.  The program can can access the private members members of a class class A. directly B. only nly th throug rough h oth other er priva rivate te membe embers rs of the class lass C. only nly thro throug ugh h oth other publi ublicc memb embers of the the cla classs D. None None of the the abo above ve - the the prog progra ram m can canno nott acc acces esss the the pri priva vate te mem membe bers rs of a clas classs in any any way way 6.  To hide a data member member from the program, you you must declare declare the data member member in the _____ _____ section of the the class A. concealed B. confidential C. hidden D. private E. restricted View Answer Workspace Report Discuss in Forum 7. External documentation includes A. B.

a printout of the program's code flowcharts

24

C. IPO charts D. pseudocode E. All of the above View Answer Workspace Report Discuss in Forum 8. A function that is called automatically each time an object is created is a(n) A. constructor B. B. contractor C. builder D. architect View Answer Workspace Report Discuss in Forum 9. A variable's _____ indicates how long the variable remains in the computer's memory A. area B. extent C. lifetime D. reach E. scope View Answer Workspace Report Discuss in Forum 10.  The function whose whose prototype is is void getData(Item *thing); receives A. a pointer to a structure B. a reference to a structure C. a copy of a structure D. nothing 11.  You may override the class access access specifier for_____  A. public members B. public and protected members C. any speci fific class members you choose D. no clas smembers View Answer Workspace Report Discuss in Forum 12.  The null character character needs a space space of  A. zero bytes B. one byte C. three bytes D. four bytes E. None of the above View Answer Workspace Report Discuss in Forum 13.  The number of of structures than can be declared declared in a single statement statement is A. one B. two C. three D. unlimited View Answer Workspace Report Discuss in Forum 14.  The cout
View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF