Вы находитесь на странице: 1из 36

1. You can use C++ as a procedural, as well as an 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 thrown object that has not been caught by an earlier catch block D. all thrown objects that have been caught by an earlier catch block 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 statement in a switch statement is A. B. C. D. E. 6. To expose optional compulsory not allowed. It gives an error message to check an error None of the above a data member to the program, you must declare the data member in the _____ section of the 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. manipulatorD. operator View Answer Workspace Report Discuss in Forum 10. A C++ program contains a function with the header int 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, they are called A. overloaded B. destructed C. ambiguous 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? A. sequence B. loop C. denial D. selection View Answer Workspace Report Discuss in Forum 15.

The newline character is always included 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, a programming language must allow A. functions that return only a single value 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 to define a 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 tests to see whether ________ A. a class has been defined B. a variable has been given a value C. a class has no variable definitions D. any objects of the class have been instantiated View Answer Workspace Report Discuss in Forum 22. Which of the following statements is false? A. A function is a block of code that performs a specific task B. Functions allow programmers to break large and complex problems into small and manageable tasks C. Functions allow programmers to use existing code to perform common tasks D. Functions can be called, or invoked, only once in a program E. Programmer-defined functions can be either value-returning or void View Answer Workspace Report Discuss in Forum 23. The generic type in a template function A. must be T B. can be T C. cannot be T for functions you create, but may be for C++'s built-in functions 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 the object using the function 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. destructor C. destroyer D. terminator 26. If you create an instantiation of a class template with an int, and then create a second instantiation with a double, then A. you must precede each function call with the word int or double B. once a function is used as one type, it becomes unavailable for use with the other type C. there is no difference in the procedure to call a member function D. you cannot perform this operation in C++ View Answer Workspace Report Discuss in Forum 27. The step-by-step instructions that solve a problem are called _____ A. B. C. D. an algorithm a list a plan a sequential structure

View Answer Workspace Report Discuss in Forum 28. The type to be used in an instantiation of a class template follows ________ A. the generic class name B. the keyword template C. the keyword class D. the template 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; B. cin >> currentPay; C. cout << currentPay; D. cout >> currentPay; E. None of the above View Answer Workspace Report Discuss in Forum 30. When you pass a variable _____, 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. 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 in a program, you begin the 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 type globally because _____ A. you save many lines of code by not rewriting an identical structure definition in each function that uses it B. you will never change its 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 beginning of a function's block of code with the _____

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 or output file, the program must include the _____ header file A. filestream.hB. 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 definitions are included in two separate #include files C. if the definitions are located in a single #include file that is included more than once D. C++ does not allow you to define the same functions more than once in the same programa 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 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 example of a good programming principle, known as _____ A. C. Section-II 1. When you omit parameters from a function call, values can be provided by A. formal parameters B. reference 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 string View Answer Workspace Report Discuss in Forum 3. reusability B. redundancy D. polymorphism recursion

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 your 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 is _____ A. void B. the class type C. the same type as the first data member defined in the class 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 parent class object must be constructed first B. the child class object must be constructed first C. the parent class object must not be constructed D. the child class object must not be constructed 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 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 override the base class function B. will cause an error message to display C. will be overridden by the base class function D. will execute immediately often the base class function executes 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 typically use a public member function to change the value in a private data member Because the constructor function does not return a value, you place the keyword void before the constructor's name The public member functions in a class can be accessed by any program that uses an object created from that class An instance of a class is considered an object

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 public members of the 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 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 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 programming that allows the same operation to be carried out differently, depending on the object, is_____ A. inheritance B. polymorphism C. overfunctioning D. overriding View Answer Workspace Report Discuss in Forum 24. When an argument is passed by reference, A. a variable is created in the function to hold the argument's value B. the function cannot access the argument's value C. a temporary variable is created in the calling program to hold the argument's value D. the function accesses the argument's original value in the calling program E. None of the above View Answer Workspace Report Discuss in Forum 25. The process of extracting the relevant attributes of an object is 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 for a derived class A. always B. if the base class constructor required arguments C. if the base class constructor does not required arguments D. never View Answer Workspace Report Discuss in Forum

29. If you want to override constructor default values for an object you are instantiating, you must also override A. all other parameters to that constructor B. all parameters to the left of that value C. all parameters to the right of that value D. no other parameters to that constructor View Answer Workspace Report Discuss in Forum 30. To use one of the C++ built-in mathematical functions, you must include the _____ header file in your program A. C. E. 31. Errors in a calculation.h expression.h mathematical.h 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; which of the following must be true? A. Each object's nonstatic data members will be stored in the same memory location B. Each object will be stored in the same memory location C. Each object will have a unique memory address D. You cannot declare two objects of the same class 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. public base class members remain public in the derived class B. protected base class members become public in the derived class C. both (a) and (b) D. neither (a) nor (b) View Answer Workspace Report Discuss in Forum 35. The operator that releases previously allocated 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. 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"; B. cin >> "Hello"; C. cout << "Hello"; D. cout >> "Hello"; E. None of the above View Answer Workspace Report Discuss in Forum 39. The preprocessor directive 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 coupling is tighter than pathological coupling Common coupling is looser than data coupling Data-structured coupling is looser than control coupling Control coupling is looser than data coupling

41. Evaluate the following expression: 7 >=3 + 4 || 6<4 && 2<5

A. True B. False View Answer Workspace Report Discuss in Forum 42. The base class for most stream classes is the _____ class A. ios B. out C. in D. app View Answer Workspace Report Discuss in Forum 43. Which of the following while clause will stop the loop when the value in the age variable is less than the number 0? A. while age < 0 B. while (age < 0) C. while age >= 0; D. while (age >= 0); E. while (age >= 0) View Answer Workspace Report Discuss in Forum 44. The most efficient data type for a variable that 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 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 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 class name from its access specifier with A. B. C. D. Section-III 1. The last 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 that can be used to change the flow of control are A. if and switch a colon two colons at least one space a semicolon

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. << C. // D. /* E. both (a) and (b) 6. If you want only one memory location to be reserved for a class variable, no matter how many objects are instantiated, you should declare the variable as A. static B. unary C. dynamic D. volatile View Answer Workspace Report Discuss in Forum 7. To use a template class member function, use the ________ with the instantiation A. scope resolution operator B. dot operator C. class definition D. keword template View Answer Workspace Report Discuss in Forum 8. When a class is derived from another derived class, the newly derived class A. may have more liberal access to a base class member than its immediate predecessor B. may have the same type of access to a base class member as its immediate predecessor C. may have more limited access to a base class member than its immediate predecessor D. both (b) and (c) View Answer Workspace Report Discuss in Forum 9. If you assign a default value to any variable in a function prototype's parameter list, then _____ A. all other parameters in the function prototype must have default values B. all parameters to the right of that variable must have default values C. all parameters to the left of that variable must have default values D. no other parameters in that prototype can have default values View Answer Workspace Report Discuss in Forum 10. The dot operator (or class member access operator) connects the following two entities (reading from left to right): A. a class member and a class object B. a class object and a class C. a class and a member of that class D. a class object and a member of that class 11. Which of the following calls a function named displayName, passing it no actual arguments? A. call displayName; B. call displayName (); C. displayName; D. displayName(); View Answer Workspace Report Discuss in Forum 12. The feature that allows you to use the same function name for separate functions that have different argument lists is called _____ A. overriding B. overloading C. constructing D. destructing View Answer Workspace Report Discuss in Forum 13. Which of the following are valid characters constants? A. '\n' B. '\\' C. '\0' D. All of the above E. None of the above View Answer Workspace Report Discuss in Forum 14. With a template class, _____ type is generic A. no B. exactly one C. at least one D. at most one View Answer Workspace Report Discuss in Forum 15. If you want to use a class to define objects in many different programs, you should define the class in a C++ _____ file A. header B. program

C.

source

D.

text

16. Functions that returns information about an object's state can be classified as ________ A. inspector functions B. mutator functions C. auxiliary functions D. manager functions View Answer Workspace Report Discuss in Forum 17. An auxiliary function _____ A. return information about data members B. changes the state of data members C. performs an action or service D. creates and destroys objects View Answer Workspace Report Discuss in Forum 18. To create and execute a C++ program, you need to have access to A. a C++ compiler B. a C++ translator C. an object code editor D. a text editor E. both (a) and (d) View Answer Workspace Report Discuss in Forum 19. If you omit any constructor argument when you instantiate an object, you must use default values______ A. for all parameters to the constructor B. for all parameters to the right of the argument C. for all parameters to the left of the argument D. for no other parameters View Answer Workspace Report Discuss in Forum 20. Many programmers separate a class into two files: _____ A. B. C. D. one one one one for for for for the the the the declarations and one for the implementations void functions and one for the other functions public data and one for the private data primary functions and one for the auxiliary functions

21. Files whose names end in .h are called _____ files A. handy B. header C. helper D. helping View Answer Workspace Report Discuss in Forum 22. When accessing a structure member, the identifier to the left of the dot operator is the name of A. a structure member B. a structure tag C. a structure variable D. the keyword struct View Answer Workspace Report Discuss in Forum 23. Assume that a program contains a programmer-defined void function. When C++ encounters the function's closing brace (}), C++ returns to the statement _____ A. immediately above the statement that called the function B. that called the function C. immediately below the statement that called the function View Answer Workspace Report Discuss in Forum 24. Inheritance occurs when a class adopts all the traits of _________ A. an object B. a parent class C. a variable D. a function View Answer Workspace Report Discuss in Forum 25. Template classes that have already been written to perform common class tasks are called _____ A. B. C. D. container classes receptacle classes repository classes alembic classes

26. A _____ is a single item of information about a person, place, or thing A. data file B. field C. program file D. record View Answer Workspace Report Discuss in Forum 27. Which (if any) of the following is NOT a programmer-defined type A. B. C. an array a structure a class

10

D. All of the above are programmer-defined types View Answer Workspace Report Discuss in Forum 28. Assume a program contains a void function named displayName, which requires no formal parameters. Which of the following is a correct function prototype for this function? A. displayName; B. displayName(void); C. void displayName; D. void displayName(); E. void displayName(none); View Answer Workspace Report Discuss in Forum 29. A file pointer always contains the address of the file A. True B. False View Answer Workspace Report Discuss in Forum 30. You declare a function with a function _____, which is typically entered at the beginning of the program, below the #include directives A. C. call definition B. D. declaration prototype

31. The function whose prototype is Item getData(void); returns _____ A. the address of a structure B. a copy of a structure C. a pointer to a structure D. nothing View Answer Workspace Report Discuss in Forum 32. Using new may result in less _____ memory than using an array A. wasted B. used C. RAM D. ROM View Answer Workspace Report Discuss in Forum 33. The most common operation used in constructors is A. addition B. overloading C. assignment D. polymorphism View Answer Workspace Report Discuss in Forum 34. In a simple 'if' statement with no 'else'. What happens if the condition following the 'if is false? A. the program searches for the last else in the program B. nothing C. control 'falls through' to the statement following 'if D. the body of the statement is executed E. None of the above View Answer Workspace Report Discuss in Forum 35. If two types of errors may be thrown, you should write _______ A. no catch blocks B. one catch block with two arguments C. two catch block-one with an argument, and one without D. two catch blocks with one argument each 36. The name of a function ends with A. double quotes B. single quotes C. parenthesis D. # E. None of the above View Answer Workspace Report Discuss in Forum 37. Which of the following is not a programming control structure? A. repetition B. selection C. sequency D. sorting View Answer Workspace Report Discuss in Forum 38. The bitwise OR operator is a A. unary operator B. binary operator C. ternary operator D. octal operator E. None of the above View Answer Workspace Report Discuss in Forum 39. A class Stockltems has four data members and three function members. You define 50 objects as members of the class. Which is true? A. Only one copy of each of the tnree functions exists B. Only one copy of each of the four data members exists C. Both (a) and (b) are true D. Neither (a) nor (b) is true View Answer Workspace Report Discuss in Forum 40. The continue statement should be written only A. in the body of a loop.

11

B. in the nested loops C. outside the body of a loop D. any where E. None of the above 41. A major advantage of inheritance is A. reducing the time it takes to create new objects B. not having to think about how objects will be used C. reducing the amount of memory required to execute a progrma D. enabling people who have not studied programming to create useful applications View Answer Workspace Report Discuss in Forum 42. When a variable exists or is accessible, it is said to be _____ A. immediate B. in the path C. available D. in scope View Answer Workspace Report Discuss in Forum 43. The feature that allows the same operations to be carried out differently depending on the object is _____ A. polymorphism B. polygamy C. inheritane D. multitasking View Answer Workspace Report Discuss in Forum 44. Which of the following is a C++ class? A. >> 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 in a flowchart is represented by a(n) _____ A. diamond B. oval 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 above are valid names for variables View Answer Workspace Report Discuss in Forum 49. Inheritance is the principle that A. B. C. D. classes with the same name must be derived from one another knowledge of a general category can be applied to more specific objects C++ functions may be used only if they have logical predecessors one function name may invoke different methods

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 for how to tie a bow is an example of the _____ 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 first catch block coded will execute C. the last catch block coded with execute D. any catch blocks coded with be bypassed 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 a derived class constructor may include 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. different names and different argument lists B. different names and the same argument list C. the same name and different argument lists D. the same name and the same argument list View Answer Workspace Report Discuss in Forum 8. You___________overload function templates A. may, as long as each version has the same arguments B. may, as long as each version has different arguments C. must D. must not View Answer Workspace Report Discuss in Forum 9. You typically initialize Character 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 object is passed to the function B. the address of the object is passed to the function C. the address of the function is passed to another function D. the address of the object is returned from the function 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. evaluate and modify (if necessary) the program 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) _____ loop because the loop condition is tested at the beginning of the loop

13

A. beginning B. initial C. pretest D. priming 16. The word case used in the switch 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 have exactly one parameter B. may have more than one parameter as long as they are of the same type C. may have more than one parameter of any type D. may not have parameters View Answer Workspace Report Discuss in Forum 18. The statement int num[2][3]={ {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 available to programs is the _____ A. C. store pile B. D. stack heap

21. The most common operation used in 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 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 memory location whose value can change while the program is running a memory location whose value cannot change while the program is running

31. To send output to a file, you need 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 variables are easier to use B. pointers are easier to use C. reference variables are more flexible D. no difference exists between reference variables and pointers 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 in memory until the program ends A. Area B. Global C. Local D. Reference E. Value 36. The outline or the definition of a 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 stored in an array can be accessed faster than data stored in a disk file B. Data stored in an array needs to be entered only once, typically at the beginning of the program C. Arrays allow the programmer to store information in the computer's internal memory D. When using arrays, you will have fewer variable names to remember E. None of the preceding statements are false View Answer Workspace Report Discuss in Forum 38. A function stub typically contains A. the function header B. the function braces C. the return statement, if it's value- returning function 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 block A. Area B. Global C. Local D. Reference E. Value View Answer Workspace Report Discuss in Forum 42. The end of string 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], empName[2]); statement will A. replace the letter M with the letter r B. replace the letter M with the letter J C. replace the letter M witht he letters S D. replace the name Mary with the name Sue E. replace the name Sue with the name Mary View Answer Workspace Report Discuss in Forum

15

45. Whis is true? A. B. C. D. A derived class may have more than one base class A base class may have more than one derived class both (a) and (b) neither (a) nor (b)

46. The keyword used to define a structure is A. stru B. stt C. struct D. unlimited View Answer Workspace Report Discuss in Forum 47. If you omit any constructor argument when you instantiate an object, you must use default values A. for all parameters to the constructor B. for all parameters to the right of the argument C. for all parameters to the left of the argument D. for no other parameters View Answer Workspace Report Discuss in Forum 48. The C++ expression p --> val means the same 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. Section-V inherited reliable B. D. reusable polymorphic

1. If no constructors can specified for a derived class, objects of the derived class will use the constructors in the base class A. True B. False View Answer Workspace Report Discuss in Forum 2. The get() function returns _____ A. a character B. void C. a reference to the object that invoked it D. a copy of the object that invoked it View Answer Workspace Report Discuss in Forum 3. The most efficient data type for a variable that the number 20000 is the _____ data 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 is a _____ constant A. character literal B. named literal C. numeric literal D. string literal View Answer Workspace Report Discuss in Forum 5. The compiler determines the type used in a template function via ___________ A. the name of the function B. the first variable declared within the function C. the type of the argument passed to the function D. the type of the value returned from the function 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 A. at the end of main() B. at the start of a program above main() C. in two files-one for the definition and one for the function D. any of the above View Answer Workspace Report Discuss in Forum

16

8. The two operators && an || are A. arithmetic operators B. equality operators C. logical operators D. relational operators E. None of the above View Answer Workspace Report Discuss in Forum 9. The arguments that determine the state of the cout object are called _____ A. classes B. manipulators C. format flags D. state 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 in a statement block or listed in a function header's parameterlist are 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 collection of data objects and operators that can be evaluated to a single value B. is a name that substitutes for a sequence of characters C. causes the computer to carry out some action 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 structure may have members of more than one type B. a structure must have members that; are all the same type C. art array may have members of more than one type D. there is no difference between a structure and an array View Answer Workspace Report Discuss in Forum 15. A default constructor _____ A. B. C. D. takes no arguments has default values for all its arguments either (a) or (b) neither (a) nor (b).

16. The number 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 its members are inherited B. all of its members are inherited, except for any private members C. all of its members are inherited, except for any protected members D. None of its members is inherited unless specifically "listed 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. Sequential cohesion is slightly weaker than functional cohesion Sequential cohesion is slightly stronger than functional cohesion Sequential cohesion is much stronger than functional cohesion

17

D. Neither sequential cohesion nor functional cohesion is stronger than the other 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 val[15]={44.123456}; A. assigns the value 44.123456 to all members of the array val B. assigns the value 44.123456 to val[0] and 0 to the rest of the members C. gives an error message D. assigns the value 44.12345 to val[1] and val[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 every object-oriented program appear within try blocks appear immediately after throw statements appear immediately after try 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 a class in two sections, 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 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 operator is represented by the 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 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 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. <= E. None of the above View Answer Workspace Report Discuss in Forum 37. Which of the following declares and initializes an Integer variable named numltems? A. int numltems = 0; B. int numltems = '0'; C. integer numltems = 0; D. numltems int = 0; E. numltems integer = 0; View Answer Workspace Report Discuss in Forum 38. Which of the following tells C++ to display numbers in fixed notation? A. setiosflags(fixed) B. setiosflags(fixed: :is) C. setiosflags(ios, fixed) D. setiosflags(ios::fixed) View Answer Workspace Report Discuss in Forum 39. The #include instruction is called a A. direction B. directive C. merge instruction D. statement. View Answer Workspace Report Discuss in Forum 40. Another drawback to returning an error code from a function is that any error code returned by the function A. B. C. D. must be of the same type as return type of the function must not be a character cannot be checked in a main() program can have multiple meanings

41. Classes hold _____ A. data B. methods C. both data and methods D. neither data nor methods View Answer Workspace Report Discuss in Forum 42. In C++, the address operator is the following symbol _____ A. >> B. & C. * D. ! View Answer Workspace Report Discuss in Forum 43. Which of the following is false? A. A pointer variable contains the address of a variable in memory B. You should both declare and initialize a pointer before you use it C. Pointers are typically initialized to the empty string ("") D. A pointer's datatype must match the datatype of the variable to which it points E. A pointer variable is typically referred to simply as a pointer View Answer Workspace Report Discuss in Forum

19

44. The function that takes 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, and Long 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. 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 after it and jumps A. to the last lines in the program B. to the next statement written after the body of the loop C. to the first statement in the body of the loop D. All. of the above E. None of the above View Answer Workspace Report Discuss in Forum 4. The function that takes 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 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 iostream is derived from istream iostream is derived from ostream ostream is derived from iostream ostream is derived from istream

20

View Answer Workspace Report Discuss in Forum 8. Providing two or more constructors for the same class _____ A. requires different argument lists B. requires different constructor names C. requires 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 in memory until the 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 reads a line of text until _____ A. the length used as the second argument is reached B. the character used as the third argument is reached C. either (a) or (b) D. neither (a) nor (b) View Answer Workspace Report Discuss in Forum 15. The extraction 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. error codes must be integers, and some functions can't return an integer C. a function can return only one value, so it can return only the error code D. a function that returns an error code will identify all returns as errors 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 enter into a C++ program is 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 derived class uses the public access specifier, the data member becomes public B. if a derived class uses the protected access specifier, the data member becomes protected 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 <iostream.h> #include iostream.h #include <iostream.h> #merge iostream.h None of the above

21. The statement double total = 0.0; performs _____ A. assignment 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 underlying object-oriented error handling is that a called function should __________ A. neither check for, nor handle errors B. check for errors but not be required to handle any detected C. handle errors, but not check for 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 function's header begins with the keyword void B. A value-returning function's header begins with a data type, which represents the type of data the function will return C. Assuming displayAge is the name of a void function, displayAge(); is a both logically and syntactically valid C++ statement D. Assuming calcNewPrice is the name of a value-returning function, calcNewPriceO; is a both logically and syntactically valid C++ statement E. Both void and value-returning functions can receive arguments. View Answer Workspace Report Discuss in Forum 25. Reference variables and const class member A. must be assigned values in any derived class B. must never be initialized in a base class C. must be initialized, rather than assigned values D. must not exit if a class is to be a base class 26. The actual arguments cannot he A. a constant or a variable B. of a different type from the corresponding formal arguments C. other functions D. expressions E. None of the above View Answer Workspace Report Discuss in Forum 27. The function stricmp("Jose", "JOSE") will return _____ A. -1 B. 0 C. 1 View Answer Workspace Report Discuss in Forum 28. Which is true? A. Coincidental cohesion is stronger than procedural cohesion B. Logical cohesion is stronger than coincidental cohesion C. Sequential cohesion is weaker than temporal cohesion D. The weakest cohesion is 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 error message to display B. will override the base class function C. will be overridden by the base class function D. will execute immediately after the base class function executes 31. The _____ function returns the uppercase equivalent of a 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 called prior to the base class constructor is called simultaneously with the base class constructor

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. B. C. D. E. 36. Typing the A class encapsulates all of an object's attributes and behaviors An example of an attribute is the minutes variable in a time class An example of a behavior is the setTime function in a time class A class is considered an object An object created from a class is referred to as an instance of the class function's name as Main, rather than main, is an 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, they are called______ A. overloaded B. destructed C. ambiguous D. dubious View Answer Workspace Report Discuss in Forum 38. A function argument is A. a variable in the function that receives a value from the calling program B. a way that functions resist accepting the calling program's values C. a value sent to the function by the calling program D. a value returned by the function to the calling program 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 integer constant such 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. protects the contents pointed to by the pointer from change B. eliminates the need to name the pointer in the function C. eliminates the need to give the pointer a type in the function D. causes a copy of the pointer to be produced in the function 41. Recursive Functions A. easier to code B. executable faster than iterative ones C. takes less main storage space D. necessary to solve a certain class of problems E. None of the above View Answer Workspace Report Discuss in Forum 42. The purpose of a conditional operator is to A. select one of the two values B. select the highest of the two values C. select one of the two values depending on a condition D. select the more equal 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 of the above are valid names for variables 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 an individual member's access more ______ A. liberal B. conservative C. either (a) or (b) D. neither (a) nor (b) 46. A class hierarchy A. describes "is a kind of" relationships B. describes "has a" relationships C. shows the same relationships as an organization chart D. shows the same relationships as a family 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 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. Section VII 1. The comma operator (,) is primarily used in conjunction with A. 'for' statement B. 'if-else' statement C. 'do-while' statement D. All of the above E. None of the above View Answer Workspace Report Discuss in Forum 2. To execute a C++ program, you first need to translate the source code into object code. This process is called A. coding B. compiling C. sourcing D. translating View Answer Workspace Report Discuss in Forum 3. The rules of a programming language are called its _____ A. code B. guidelines C. procedures D. regulations E. syntax View Answer Workspace Report Discuss in Forum 4. An array element is accessed using A. a first-in-first-out approach B. the dot operator C. a member name D. an index number View Answer Workspace Report Discuss in Forum 5. The program can access the private members of a class A. directly B. only through other private members of the class C. only through other public members of the class D. None of the above - the program cannot access the private members of a class in any way 6. To hide a data member from the program, you must declare the data member in the _____ section of 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 stored with each program that uses them stored in a header file that is included in the programs that use them stored in a folder that you paste into every new project retyped for every new project

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. 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 prototype 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 specifier for_____ A. public members B. public and protected members C. any specific class members you choose D. no clas smembers View Answer Workspace Report Discuss in Forum 12. The null character needs a 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 structures than can be declared in a single statement is A. one B. two C. three D. unlimited View Answer Workspace Report Discuss in Forum 14. The cout << sales[0] + sales[1]; statement will______ A. display 22000 B. display 10000 + 12000 C. display sales[0] + sales[l] D. result in an error View Answer Workspace Report Discuss in Forum 15. The most efficient data type for a variable that stores the letter C is the _____ data type A. Character B. Double C. Float D. Long Integer E. Short Integer 16. The C++ operator used to allocate memory is _________ A. mem B. allocate C. new D. create View Answer Workspace Report Discuss in Forum 17. Assume that your version of C++ can recognize only the first 8 characters of an identifier name, through identifier names may be arbitrarily long. Which of the following identifier names is not distinct: A. list, list2 B. address, Address C. identifier_l, identifier_2 D. answer, ANSWER E. None of the above View Answer Workspace Report Discuss in Forum 18. Object is to class as _____ A. library is to book B. mother is to daughter C. Plato is to philosopher D. president is to Lincoln View Answer Workspace Report Discuss in Forum 19. A derived class may also be called a A. subclass B. super class C. parent class D. base class View Answer Workspace Report Discuss in Forum

25

20. The C++ keyword for declaring a variable that contains a decimal point is _____ A. dec B. decimal C. float D. floater E. None of the above 21. When you define an object that is a member of a class, such as Student Abby; _____ A. a block of memory is set aside and all data members are assigned valid values B. a block of memory is set aside C. no memory is set aside until values are defined D. no memory is set aside, but valid values are assigned to data members View Answer Workspace Report Discuss in Forum 22. A program can directly access the _____ members of a class A. hidden B. private C. public D. both (b) and (c) View Answer Workspace Report Discuss in Forum 23. Any output manipulator function you create _____ A. should take as an argument an instance of ostream as a reference B. should return void C. must be a member function of the ostream class D. must inherit ostream View Answer Workspace Report Discuss in Forum 24. To pass an array by reference, you A. must include the address-of (&) operator before the array's name B. must include the number symbol (#) before the array's name C. do not have to do anything because arrays are automatically passed by reference View Answer Workspace Report Discuss in Forum 25. The instructions you enter into the computer are called the _____ A. B. C. D. edited code machine code object code source code

26. The String data type is an extension of the _____ data type A. Character B. Double C. Letter D. Long E. Text View Answer Workspace Report Discuss in Forum 27. An advantage of using local variables is that _____ A. they are known to all functions in the file B. names used in one function do not affect data stored in variables with the same names in other functions C. values given to local variables are retained when those parameters go out of scope D. the program does not become "crowded" with too many variable names View Answer Workspace Report Discuss in Forum 28. The difference between a return and a throw is that _____ A. with a throw, no value can be sent B. with a return, no value can be sent C. with a throw, execution takes place at the location from which the function was called D. with a return, execution takes place at the location from which the function was called View Answer Workspace Report Discuss in Forum 29. Which is a good reason for passing a variable's address to a function? A. the function will have a copy of the variable B. the function cannot change the value of the variable in the calling function C. C++ requires that all variables used in a function be passed by address D. the function needs to change multiple variable values E. the called function can change the value of the variable in the calling function View Answer Workspace Report Discuss in Forum 30. The string HELLO WORLD needs A. B. C. D. E. 11 bytes 12 bytes 10 Bytes 8 bytes None of the above

31. Library header files usually contain A. B. C. D. complete functions parts of functions function prototypes for functions stored in other files function bodies, but not function headers

26

View Answer Workspace Report Discuss in Forum 32. A C++ term meaning "generic" is A. argument B. parameterized C. universal D. global View Answer Workspace Report Discuss in Forum 33. Before object-oriented exception handling was practiced, _____ A. no run-time errors occurred B. programmers could not deal with run-time errors C. the most popular error-handling method was to terminate the program D. the most popular error-handling method was to throw an exception View Answer Workspace Report Discuss in Forum 34. The preprocessor directive always ends with A. a comma B. a semicolon C. neither a semicolon nor a comma D. "/" E. None of the above View Answer Workspace Report Discuss in Forum 35. A constructor initialization list produces similar results to A. overriding B. assignment C. redeclaring D. output 36. Which of the following stream manipulators advances the cursor to the next line on the computer screen? A. adin B. advin C. edlin D. endl E. lineadv View Answer Workspace Report Discuss in Forum 37. 6.5 is a _____ constant A. character literal B. named literal C. numeric literal D. string literal View Answer Workspace Report Discuss in Forum 38. The time and memory involved in calling a function represent the function's _____ A. prototype B. overhead C. cost D. burden View Answer Workspace Report Discuss in Forum 39. Which function is most likely to have procedural cohesion? A. main() B. findSquareRoot() C. getSaleSubtractDiscountAddTax() D. View Answer Workspace Report Discuss in Forum 40. A pointer is openFiles()

A. the address of a variable B. an indication of the variable to be accessed next C. a variable for storing addresses D. the data type of an address variable 41. The instruction "If it's raining outside, then take an umbrella to work" is an example of the _____ structure A. control B. repetition C. selection D. sequence E. switching View Answer Workspace Report Discuss in Forum 42. Which of the following statements will assign the address of the age variable to the agePtr pointer? A. agePtr = &age; B. agePtr = *age; C. &agePtr = age; D. *agePtr = age; E. agePtr -> *age; View Answer Workspace Report Discuss in Forum 43. The >> (extraction) operator stops reading characters from the keyboard as soon as the user _____ A. presses the Enter key B. types a character that is inappropriate for the variable's data type C. both (a) and (b) View Answer Workspace Report Discuss in Forum 44. In the statement template<class T>, A. T is a class B. T is a scalar variable C. either (a) or (b) D. neither (a) nor (b) View Answer Workspace Report Discuss in Forum 45.

27

The null character is represented by A. \n B. \0 C. \o D. \r E. None of the above 46. The break statement is A. a preprocessor directive B. an operator in the C++ language C. a keyword in the C++ language D. switch in the C++ language E. None of the above View Answer Workspace Report Discuss in Forum 47. A variable w with a value 67 may be defined with _______ A. int w = 67; B. int w(67); C. int 67(w); D. both (a) and (b), but not (c). View Answer Workspace Report Discuss in Forum 48. An expression contains relational, assignment and arithmetic operators. In the absence of parentheses, the order of evaluation will be A. assignment, relational, arithmetic B. arithmetic, relational, assignment C. relational, arithmetic, assignment D. assignment, arithmetic, relational E. None of the above View Answer Workspace Report Discuss in Forum 49. The keyword virtual indicates that A. a derived class has public access to a base class B. more than one base class exists C. a base class should be used only once in inheritance D. a derived class should have more than one base class constructed View Answer Workspace Report Discuss in Forum 50. If you declare two objects as Customer firstCust, secondCust; which of the following must be true? A. B. C. D. Each object will store a separate copy of any static member data Each object will store a separate copy of any member functions Each object will store a separate copy of any nonstatic data members You cannot declare two objects of the same class

Section-VIII 1. Variables that are declared in a block are known as _____ variables to that block A. confined B. local C. global D. immediate View Answer Workspace Report Discuss in Forum 2. The pow and sqrt functions return a(n) _____ type number A. double B. float C. integer D. long E. short View Answer Workspace Report Discuss in Forum 3. Declaring variables is advantageous because it A. avoids errors from misspelled variable names {b) helps the linker work efficiently B. simplifies the writing of very short programs C. All of the above D. None of the above View Answer Workspace Report Discuss in Forum 4. The generic name used for unexpected errors that occur during the execution of a program is A. infractions B. exceptions C. deviations D. anomalies View Answer Workspace Report Discuss in Forum 5. You add the desired type to a specific template class instantiation by placing the type's name ______ A. B. C. D. 6. The switch between angle brackets in parentheses on a line by itself immediately prior to the class name variable can be of

A. int type only B. char type only C. both int as well as char type D. float type only E. None of the above View Answer Workspace Report Discuss in Forum

28

7. Reference variables and const class members _____ A. must be assigned values in any derived class B. must never be initialized in a base class C. must be initialized, rather than assigned values D. must not exist if a class is to be a base class View Answer Workspace Report Discuss in Forum 8. You can code a default exception handler by creating a catch block A. with no arguments B. with a void argument C. with an ellipsis as its argument D. with an argument identical to that thrown View Answer Workspace Report Discuss in Forum 9. Which of the following are void functions? A. main B. pow C. sqrt D. All of the above View Answer Workspace Report Discuss in Forum 10. Hiding individual components of an entry is _____ A. polymorphism B. encapsulation C. scaling D. not recommended in C++ 11. When all of the operations in a function contribute to the performance of only one task, a function has A. singular cohesion B. tight cohesion C. functional cohesion D. sequential cohesion View Answer Workspace Report Discuss in Forum 12. A function that uses variable types is called __________ A. overloaded B. a template function C. a variable function D. a virtual function View Answer Workspace Report Discuss in Forum 13. Having more than one function with the same name is called A. overloading B. defaulting C. casting D. referencing View Answer Workspace Report Discuss in Forum 14. An object is _____ A. a category of classes B. a name given to a class C. an instance of a class D. the same as a class View Answer Workspace Report Discuss in Forum 15. Two access specifers in C++ are A. public and private B. int and double C. formal and informal D. void and free 16. A data member holds a 1 or 0 depending on whether taxes have been paid. The best identifier for this member is _____ A. taxes B. paidTaxes C. taxesArePaid D. code View Answer Workspace Report Discuss in Forum 17. Assume a class Derv that is privately derived from class Base. An object of class Derv located in main() can access A. public members of Base B. protected members of Base C. private members of Base D. public members of Derv View Answer Workspace Report Discuss in Forum 18. Which of the following is an access specifier? A. particular B. shielded C. protected D. safe View Answer Workspace Report Discuss in Forum 19. Machine code is _____ A. B. C. D. edited code source code the 0s and 1s that the computer can understand both (b) and (c)

29

View Answer Workspace Report Discuss in Forum 20. The contents of two pointers that point to adjacent of type float differ by A. B. C. D. one bytes two bytes three bytes four bytes

21. Which of the following is a valid condition for an if statement? (The condition should be both syntactically and logically valid.) A. (age) > 65 B. (age > 0 and < 10) C. (sales > 500 && < 800) D. (sales > 100 && sales <= 1000) E. (sales > 100 || sales <= 1000) View Answer Workspace Report Discuss in Forum 22. A pattern for creating an object is called a(n) _____ A. class B. attributes C. private D. public View Answer Workspace Report Discuss in Forum 23. An asterisk placed after a data type means . A. array to B. pointer to C. address to D. located to View Answer Workspace Report Discuss in Forum 24. An object is a(n) _____ of a class A. owner B. function C. definition D. instance View Answer Workspace Report Discuss in Forum 25. Which of the following statements creates and initializes a pointer named salesPtr? A. salesPtr = NULL; B. *salesPtr = ""; C. float &salesPtr = NULL; D. float *salesPtr = ""; E. float *salesPtr = NULL; 26. With communicational cohesion A. a tasks and the data are related B. the tasks are related; the data are not C. the data are related; the tasks are not D. the tasks and the data are unrelated View Answer Workspace Report Discuss in Forum 27. The function printDataMembers() is mot likely a(n) ________ A. inspector functions B. mutator functions C. auxiliary functions D. manager functions View Answer Workspace Report Discuss in Forum 28. The data type listed at the beginning of a value-returning function's header indicates the type of data the function will _____ A. return B. pass C. receive D. [NIL] View Answer Workspace Report Discuss in Forum 29. The code class Descendant : virtual public Ancestor indicates that A. the members of Ancestor will be included more than once in Descendant B. the members of Ancestor will be included only once in Descendant C. the members of Descendant will be included more than once in Ancestor D. the members of Descendant will be included only once in Ancestor View Answer Workspace Report Discuss in Forum 30. Inheritance is the principle that A. Classes with the same name must be derived from one another B. Knowledge of a general category can be applied to more specific objects C. C++ functions may be used only if they have logical predecessors D. One function name may invoke different methods 31. Which of the following formulas can be used to generate random integers between 1 and 10? A. 1 + rand() % (10 - 1 + 1) B. 1 + (10 - 1 + 1) % rand() C. 10 + rand() % (10 - 1 + 1) D. 10 + rand() % (10 + 1) View Answer Workspace Report Discuss in Forum 32. Format flags may be combined using the _____ A. bitwise OR operator(|)

30

B. logical OR operator (||) C. bitwise AND operator (&) D. logical AND operator (&&) View Answer Workspace Report Discuss in Forum 33. Which of the following will store the number 320000 as a Float number? A. counPop = (float) 3.2e5; B. counPop = (float) 3.2e6; C. counPop = (float) .32e5; D. counPop = (float) .32e7; E. counPop = (float) 3.2-e5; View Answer Workspace Report Discuss in Forum 34. The arguments that determine the state of the cout object are called A. classes B. manipulators C. format flags or state flags D. state controllers View Answer Workspace Report Discuss in Forum 35. If a class will serve as a base class, most often the base class data members are A. private B. protected C. public D. polymorphic 36. You can use the C++ _____ function to assign a value to a String variable A. assign B. copy C. string D. strcopy E. strcpy View Answer Workspace Report Discuss in Forum 37. A measure of the strength of the connection between two functions is A. cohesion B. coupling C. dependence D. subjection View Answer Workspace Report Discuss in Forum 38. The following statement where T is true and F is false T&&T||F&&T A. is true B. is false C. is wrong D. not applicable in C language E. None of the above View Answer Workspace Report Discuss in Forum 39. Which of the following statements declares a variable that can contain a decimal number? A. dec payRate; B. dec hourlyPay C. float payRate D. float hourlyPay; E. None of the above View Answer Workspace Report Discuss in Forum 40. The statement int num[2][3]={ {1,2}, {3,4}, {5, 6} }; A. assigns a value 2 to num[1][2] B. assigns a value 4 to num[1][2] C. gives an error message D. assigns a value 3 to num[1][2] 41. A program will have one function prototype for each function defined in the programmer-defined section of the program. (Assume that the programmer-defined section is located below the main function.) A. true B. false View Answer Workspace Report Discuss in Forum 42. The standard input stream, which refers to the keyboard, is called A. cin B. cout C. stin D. stout E. None of the above View Answer Workspace Report Discuss in Forum 43. If the code and fee arrays are parallel, the fee that corresponds to the code stored in the code[3] element is located in the _____ element A. code[2] B. code[3] C. fee[2] D. fee[3] View Answer Workspace Report Discuss in Forum 44. Access specifiers are followed by A. a comma B. a semicolon C. a colon D. two colons View Answer Workspace Report Discuss in Forum 45. Elements in an array are identified by a unique _____

31

A. B. C. D.

data type order subscript symbol

46. To include the double quotes as part of the control string we use the symbol A. %" B. "" C. \" D. # E. None of the above View Answer Workspace Report Discuss in Forum 47. A C++ statement must end in a A. : (column) B. , (comma) C. . (period) D. ; (semicolon) View Answer Workspace Report Discuss in Forum 48. Student senior(); is a(n)_________ A. constructor call with no arguments B. object instantiation C. constructor call with all default arguments D. prototype for a function that returns a student object View Answer Workspace Report Discuss in Forum 49. The statement int n[4] = {11, -13, 17, 105}; A. B. C. D. assigns the value -13 to [2] assigns the value 17 to n[2] is wrong; it gives an error message assigns the value 18 to n[2]

1. Programmer-defined functions can be A. value-returning functions only B. void functions only C. either value-returning or void functions View Answer Workspace Report Discuss in Forum 2. A class D can be derived from a class C, which is derived from a class B, which is derived from a class A A. True B. False View Answer Workspace Report Discuss in Forum 3. To use the strcpy function, you must include the _____ header file in your program A. assign.h B. copy.h C. string.h D. strcopy.h E. strcpy.h View Answer Workspace Report Discuss in Forum 4. The number of the relational operators in the C language is A. four B. six C. three D. one E. None of the above View Answer Workspace Report Discuss in Forum 5. Which of the following tells C++ to display numbers with two decimal places? A. C. setdecimal(2) setiosflags(2.00) B. D. setiosflags(2) setprecision(2)

6. A function that is called automatically each time an object is destroyed is a A. constructor B. destructor C. destroyer D. terminator View Answer Workspace Report Discuss in Forum 7. We can output text to an object of class ofstream using the insertion operator because A. the ofstream class is a stream B. the insertion operator works with all classes C. we are actually outputting to cout D. the insertion operator is overloaded in ofstream View Answer Workspace Report Discuss in Forum 8. The operator that allocates new memory is _____ A. allocate B. mem C. new D. next View Answer Workspace Report Discuss in Forum

32

9. A comment A. is a note that can be put into the source code B. is ignored by the compiler. C. starts with the /* character pair D. All of the above E. None of the above View Answer Workspace Report Discuss in Forum 10. Which of the following is(are) valid identifier(s)? A. record_1 B. 1 record C. return D. $tax E. None of the above 11. The functions go in the _____ section of a class definition A. declaration B. implementation C. prototype D. functioning View Answer Workspace Report Discuss in Forum 12. You can throw _____ A. a scalar variable B. a constant C. a programmer-defined class object D. any of these View Answer Workspace Report Discuss in Forum 13. You invoke a function with a function A. call B. declaration C. definition D. prototype View Answer Workspace Report Discuss in Forum 14. Which is a good guideline for creating function names? A. Use all lowercase letters to identify the functions as C++ functions B. Use long names to reduce the likelihood of creating a duplicate function name C. Use abbreviations as much as possible to save both keystrokes and memory D. Avoid the use of digits because they are easily confused with letters View Answer Workspace Report Discuss in Forum 15. Reserving memory during program execution is known as reserving it A. dynamicallyB. C. functionally D. 16. "Rohan Motors" is a _____ statically powerfully

A. character literal constant B. numeric literal constant C. string literal constant D. variable View Answer Workspace Report Discuss in Forum 17. A programming structure that contains data and a pointer to the next object is a A. template B. class C. pointer class D. linked list View Answer Workspace Report Discuss in Forum 18. A variable declared in a function is called a(n) _____ variable A. area B. global C. local D. reference E. value View Answer Workspace Report Discuss in Forum 19. When you write to a file rather than the screen, you use the C++ class _____ A. iostream B. filed C. fstream D. diskclass View Answer Workspace Report Discuss in Forum 20. Which of the following numerical value(s) is(are) invalid constant(s)? A. B. C. D. E. 21. To use the 0.7 9.3el2 27,512 12345678 None of the above this pointer with a member function, you _____

A. declare this as static B. declare this as global C. define this as equal to the address of the appropriate object D. do nothing; it is automatically supplied for you View Answer Workspace Report Discuss in Forum

33

22. A function that is prototype as int calculate(int num); may A. receive an integer variable named num from the main() program B. receive any integer variable from the main() program C. either (a) or (b) D. neither (a) nor (b) View Answer Workspace Report Discuss in Forum 23. A do-while loop contains A. only one statement between the do statement and the while statement B. several statements between the do statement and the while statement C. no statement at all between the do statement and the while statement D. only two statement between the do statement and the while statement E. None of the above View Answer Workspace Report Discuss in Forum 24. The braces that surround the code in a 'C program A. show what code goes in a particular function B. delimit a section of code C. separate the codes from the constant D. separate the source file from the subject file E. None of the above View Answer Workspace Report Discuss in Forum 25. The indirection operator is the A. asterisk B. ampersand C. dollar sign D. plus sign 26. Local variables _____ A. are created outside a block B. are known only to that block C. continue to exist when their block ends D. are illegal in C++ View Answer Workspace Report Discuss in Forum 27. # directives must be present A. before the main() function B. after the main() function C. at the end of the program D. anywhere in the program body E. None of the above View Answer Workspace Report Discuss in Forum 28. Programmers prefer to declare almost all variables _____ A. at the beginning of each function B. globally C. on one line D. with cryptic names View Answer Workspace Report Discuss in Forum 29. A(n) _____ is always incremented by a constant amount, whereas a(n) _____ is incremented by an amount that varies A. accumulator, counter B. counter, accumulator View Answer Workspace Report Discuss in Forum 30. The C++ _____ function generates random numbers A. generate() B. genRand C. rand D. randGen E. srand 31. You have declared an integer pointer called point You have also declared an integer called number. Which statement is the correct format? A. point = number; B. point = *number; C. point = &number; D. point = +number; View Answer Workspace Report Discuss in Forum 32. If you wanted to sort many large objects or structures, it would be most efficient to A. place them in an array and sort the array B. place pointers to them in an array and sort the array C. place them in a linked list and sort the linked list D. place references to them in an array and sort the array View Answer Workspace Report Discuss in Forum 33. A function that is prototyped as double calculate(int num); may ______ A. receive a double constant such as 3.9 B. receive a double variable C. either (a) or (b) D. neither (a) nor (b) View Answer Workspace Report Discuss in Forum 34.

34

The printer can be accessed using the predefined filename _____ A. printer file B. print C. cout D. PRN, LPT1, etc View Answer Workspace Report Discuss in Forum 35. The best functions have _____ A. B. C. D. 36. One of the high cohesion and tight coupling high cohesion and loose coupling low cohesion and tight coupling low cohesion and loose coupling valid escape sequences used in the C language is

A. \z B. \N C. \t D. \s E. None of the above View Answer Workspace Report Discuss in Forum 37. A default constructor A. takes no arguments B. has default values for all its arguments C. either (a) or (b) D. neither (a) nor (b) View Answer Workspace Report Discuss in Forum 38. Which of the following will increase the value stored in the first element of the fee array by 2? A. amount[0] = amount[0] + 2; B. amount, fee[0] = amount, fee [0] + 2; C. feelnfo.amount[0] = feelnfo.amount[0] + 2; D. fee[0].amount = fee[0].amount + 2; E. fee.amount[0] = fee.amount[0] + 2; View Answer Workspace Report Discuss in Forum 39. Which loop always processes its instructions at least once? A. do-while B. for C. while D. [NIL] View Answer Workspace Report Discuss in Forum 40. When a new class is derived from an existing class, the derived class member functions _____ have names that differ from base class function names A. may B. may if the two classes have the same name C. must D. must not 41. 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 42. _____ refers to the process of locating and removing the errors in a program A. Analyzing B. Correcting C. Debugging D. Executing E. Tracking View Answer Workspace Report Discuss in Forum 43. Static variables are sometimes called A. class variables B. functional variables C. dynamic variables D. auto variables View Answer Workspace Report Discuss in Forum 44. You can pass _____ to functions A. copies of individual structure members B. copies of entire structures C. pointers to structures D. All of the above View Answer Workspace Report Discuss in Forum 45. Element doubleArray[7] is which element of the array? A. B. C. D. the sixth the seventh the eighth impossible to tell

46. Which of the following statements opens a file named temp.dat for output?

35

A. outFile.open("temp .dat"); B. fileOut.output("temp .dat"); C. openFile.out("temp .dat"); D. fileOpen.out("temp .dat"); E. out.fileOpen("temp .dat"); View Answer Workspace Report Discuss in Forum 47. Which of the following will store the letter H in a Character variable named initial? A. initial = 'H' B. initial = 'H'; C. initial = "H" D. initial = "H"; View Answer Workspace Report Discuss in Forum 48. Compared with the classes from which they are derived, inherited classes may have _____ A. additional data members B. additional member functions C. both (a) and (b) D. neither (a) nor (b) View Answer Workspace Report Discuss in Forum 49. A class named Student must have a constructor whose name is A. Student B. ~Student C. constructor D. any legal C++ name View Answer Workspace Report Discuss in Forum 50. To write data that contains variables of type float, to an object of type ofstream, you should use A. B. C. D. the insertion operator seekg() writeQ put()

36