Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 4 out of 40 pages
Exam (elaborations)

CISP 400 quizzes 1-6 2nd version attempt | Answered latest 100% 2025/26.

Document preview thumbnail
Preview 4 out of 40 pages

CISP 400 quizzes 1-6 2nd version attempt | Answered latest 100% 2025/26. Q1 LATEST Attempt 2 23 minutes 100 out of 100 Question 1 5 / 5 pts Increase compatibility with the C programming language. Improve library building capabilities. Make C++ easier to learn. Make C++ an open source programming language. Section 1.14 C++11 and C++14: The Latest C++ Versions  This quiz covers chapter 1 & 2 of the textbook material. Please review the material first before take this test. After you start the test you have 30 minutes to complete it. Take the Quiz Again Which of the following is not a goal stated by the creator of C++ for the new C++ standard? Question 2 5 / 5 pts Preprocessor. Compiler. Loader. Interpreter. Section 1.9 Typical C++ Development Environment  Question 3 5 / 5 pts C or C++. Visual C#. Objective-C. Ada. Section 1.7 Programming Languages  Question 4 5 / 5 pts attributes function class reuse 1.8 Introduction to Object Technology  Question 5 5 / 5 pts The ___________ creates object code and stores it on disk. Today, virtually all new major operating systems are written in: The size, shape, color and weight of an object are considered __________ of the object’s class. The Unified Design Language None of the above The Unified Modeling Language The Unified Graphical Language Section 1.8 Introduction to Object Technology  Question 6 5 / 5 pts Global Positioning System (GPS) devices a single satellite to retrieve location-based information. Electronic health records enable health care providers to share patients’ information across a secure network, improving patient care, reducing the probability of error and increasing overall efficiency of the health care system. The Human Genome Project was founded to identify and analyze the 20,000+ genes in human DNA. Cloud computing allows you to use software, hardware and information stored on remote computers via the Internet and available on demand—rather than having it stored on your personal computer. Section 1.2 Computers and the Internet in Industry and Research  Question 7 5 / 5 pts programs. arithmetic and logic unit central processing unit secondary storage unit Ch1  Question 8 5 / 5 pts ________ is a graphical language that allows people who design software systems to use an industry stan¬dard notation to represent them. Which of the following statements is false? Computers process data under the control of sets of instructions called type, preprocess, compile, link, load, execute edit, preprocess, compile, link, load, execute type, debug, compile, search, load, execute type, debug, compile, link, load, execute 1.9 Typical C++ Development Environment  Question 9 5 / 5 pts Classes are reusable software components. A class is an instance of its object. Section 1.8 Introduction to Object Technology Performing a task in a program requires a method. A class is to an object as a blueprint is to a house. Section 1.8 Introduction to Object Technology  Question 10 5 / 5 pts TCP/IP Web 2.0 URL (Uniform Resource Locator). HyperText Transfer Protocol (HTTP). Section 1.12 Internet and the World Wide Web  Question 11 5 / 5 pts C++ programs normally go through six phases— _____, _________, __________, _______, _______, and _______________. Which statement is false? ________ is a communications protocol used to send information over the web. Which of the following data items are arranged from the smallest to the largest in the data hierarchy. bits, files, fields, records, characters. bits, characters, fields, records, files. fields, characters, bits, files, records. records, characters, fields, bits, files. Section 1.4 Data Hierarchy  Question 12 5 / 5 pts Speaking to your computer is a form of input. A multi-core processor implements several processors on a single integrated-circuit chip. Information in the memory unit is persistent—it is retained when the computer's power is turned off. Playing a video is an example of output. Section 1.3 Hardware and Software  Question 13 5 / 5 pts width = length; number = 12; int a; y = y + 2; Section 2.5 Memory Concepts  Question 14 5 / 5 pts = Which of the following statements is false? Which of the following statements does not overwrite a preexisting value stored in a memory location? The assignment operator ________ assigns the value of the expression on its right to the variable on its left. # - - Section 2.4 Another C++ Program: Adding Integers  Question 15 5 / 5 pts std::cout "hello"; std::cout " there"; std::cout "hello" , " there"; std::cout "hello "; std::cout " there"; std::cout "hello"; std::cout "there"; Section 2.3 Modifying Our First C++ Program  Question 16 5 / 5 pts std include main. return 2.2 First Program in C++ ; Printing a Line of Text  Question 17 5 / 5 pts int count = 0; int count[0]; int count(0); Which of the following code segments prints a single line containing hello there with the words separated by a single space? Every C++ program begins execution at the function _________ . Which of the following uses C++11's list initialization to initialize count to 0? int count{0}; Section 2.4 Another C++ Program: Adding Integers  Question 18 5 / 5 pts *, /, %, -, + +, -, /, *, % -, +, %, *, / -, *, %, +, / Section 2.6 Arithmetic  Question 19 5 / 5 pts t n a r Section 2.2 First Program in C++: Printing a Line of Text  Question 20 5 / 5 pts In what order would the following operators be evaluated -, *, /, +, % Assume that if two operations have the same precedence, the one listed first will be evaluated first. The escape sequence for a newline is: What is the value of result after the following C++ statements execute? 119 127 51 59 Section 2.6 Arithmetic Quiz Score: 100 out of 100 int a{4}; int b{12}; int c{37}; int d{51}; int result{d % a * c + a % b + a}; Q3 Due Sep 14 at 12:01pm Points 100 Questions 20 Available until Sep 14 at 12:01pm Time Limit 30 Minutes Allowed Attempts 3 Instructions Attempt History Attempt Time Score KEPT Attempt 2 30 minutes 100 out of 100 LATEST Attempt 2 30 minutes 100 out of 100 Attempt 1 30 minutes 95 out of 100 Score for this attempt: 100 out of 100 Submitted Sep 13 at 12:59am This attempt took 30 minutes.  Question 1 5 / 5 pts To store true/false values. To perform monetary calculations. . As counters. As approximate representations of decimal numbers Section 5.6 Application: Compound-Interest Calculations  This quiz covers chapter 5 & 6 of the textbook material. Please review the material first before take this test. After you start the test you have 30 minutes to complete it. Take the Quiz Again float and double variables should be used: Question 2 5 / 5 pts The relational operator. The = assignment operator. The % arithmetic operator. The ! logical operator. Section 5.11 Logical Operators  Question 3 5 / 5 pts long All of the above. char short Section 5.9 switch Multiple-Selection Statement  Question 4 5 / 5 pts Print the numbers 1 through 10. Print the numbers 1 through 11. Cause a syntax error. An example of a unary operator is: Which of the following data types can be used to represent integers? What will the following program segment do? int counter{1}; do { cout counter " "; } while (++counter = 10); Print the numbers 1 through 9. Section 5.8 do…while Iteration Statement  Question 5 5 / 5 pts do…while switch if break Section 5.13 Structured Programming Summary  Question 6 5 / 5 pts Does not evaluate correctly and should be replaced by (4 y && y 1). Does not evaluate correctly and should not be replaced by (4 y && y 1). Evaluates correctly and could not be replaced by (4 y && y 1). Evaluates correctly and could be replaced by (4 y && y 1). Section 5.11 Logical Operators  Question 7 5 / 5 pts The body of the loop will execute at least once. An infinite loop cannot take place. Counter-controlled iteration is not possible. An off-by-one error cannot occur. Section 5.8 do…while Iteration Statement Which of the following is not one of the C++ control structures? In C++, the condition (4 y 1): If a do…while structure is used:  Question 8 5 / 5 pts +. ,. ?:. &&. Section 6.19 Example Using Recursion: Fibonacci Series  Question 9 5 / 5 pts None. Two. Three. One. Section 6.14 Default Arguments  Question 10 5 / 5 pts Calling the correct function. Specifying return types. The agreement of the arguments and parameters. Name mangling. Section 6.16 Function Overloading  Question 11 5 / 5 pts For which of the following operators does C++ not specify the order of evaluation of its operands? If the function int volume(int x = 1, int y = 1, int z = 1); is called by the expression volume(3), how many default arguments are used? Type-safe linkage is ensured by: Variable type. Function. CD-ROM. Header. Section 6.6 C++ Standard Library Headers  Question 12 5 / 5 pts Different parameter lists. Different return types. The same number of parameters. The same number of default arguments. Section 6.16 Function Overloading  Question 13 5 / 5 pts The “outer” variable is irretrievably lost when the “inner” variable is declared. The “inner” declaration is ignored and the “outer” variable has scope even inside the inner block. The “outer” variable is hidden while the “inner” variable is in scope. A syntax error occurs. Section 6.10 Scope Rules  Question 14 5 / 5 pts Be reused any number of times. Each standard library has a corresponding: Overloaded functions must have: What happens when two blocks, one nested inside of the other, both declare variables with the same identifier? (Assume that the outer block declares its variable before the opening left-brace of the inner block.) Functions can: Be used as building blocks to create new programs. Return a result to the caller function. Do all of the above. Section 6.2 Program Components in C++  Question 15 5 / 5 pts The return address of its caller function. The name of the function. Local variables it has declared. Parameter values received from its caller. Section 6.11 Function Call Stack and Activation Records  Question 16 5 / 5 pts To access a local variable with the same name as a global variable. To access a global variable when a local variable of the same name is in scope. To access a global variable when it is out of scope. To access any variable in an outer block when a local variable of the same name is in scope. Section 6.15 Unary Scope Resolution Operator  Question 17 5 / 5 pts Which of the following is not included in a function’s activation record? The unary scope resolution operator is used: Given the following function template template typename T T maximum(T value1, T value2) { if (value1 value2) { return value1; 5 and 5.2. 5 and a type-mismatch error. Two error messages. 2 and 2.3. Section 6.17 Function Templates  Question 18 5 / 5 pts B. D. C. A. Section 6.4 Function Prototypes  Question 19 5 / 5 pts } else { return value2; }} what would be returned by the following two function calls? maximum(2, 5); maximum(2.3, 5.2); Using the following function definition, the parameter list is represented by: A B (C) {D} The function prototype double mySqrt(int x); Declares a function called mySqrt which takes a double as an argument and returns an integer. Declares a function called mySqrt which takes an integer as an argument and returns a double. Defines a function called mySqrt which takes an argument of type x and returns a double. Defines a function called double which calculates square roots. Section 6.4 Function Prototypes  Question 20 5 / 5 pts The identifiers in an enum class must be unique, but separate enumeration constants can have the same integer value. To reference a scoped enum constant, you must qualify the constant with the scoped enum’s type name and the scoperesolution operator (:), as in MaritalStatus:SINGLE. A scoped enumeration is introduced by the keywords enum class, followed by a type name and a set of identifiers representing integer constants. By convention, you should capitalize the first letter of an enum class’s name. Section 6.8 Case Study: Game of Chance; Introducing Scoped enums Quiz Score: 100 out of 100 [C++11] Which of the following statements about scoped enumerations is false? Q4 Due Sep 21 at 12:01pm Points 100 Questions 20 Available until Sep 21 at 12:01pm Time Limit 30 Minutes Allowed Attempts 3 Instructions Attempt History Attempt Time Score KEPT Attempt 1 30 minutes 95 out of 100 LATEST Attempt 2 30 minutes 90 out of 100 Attempt 1 30 minutes 95 out of 100 Score for this attempt: 90 out of 100 Submitted Sep 21 at 4:22am This attempt took 30 minutes.  Question 1 5 / 5 pts The inner for loop increments its counter variable. The outer for loop initializes its counter variable. The inner for loop initializes its counter variable. The outer for loop increments its counter variable. Section 7.9 Case Study: Class GradeBook Using a Two-Dimensional array  This quiz covers chapter 7 & chapter 8 of the textbook material. Please review the material first before take this test. After you start the test you have 30 minutes to complete it. Take the Quiz Again In a typical nested for loop (not a range-based for loop) used to process a two-dimensional array, following the end of each execution of the inner for loop: Question 2 5 / 5 pts None of the above. sort_array function. array_sort function. sort function. Section 7.7 Sorting and Searching arrays  Question 3 0 / 5 pts Correct Answer fractions[8] = 1.667; [9]fractions = 1.667; fractions[10] = 1.667; You Answered fractions[9] = 1.667; 7.4.1 Declaring an array and Using a Loop to Initialize the array’s Elements  Question 4 5 / 5 pts None of the above statements in false. The catch block contains the code that handles an exception if one occurs. Call the exception object's what member function to get the error message that's stored in the exception object. Bounds checking is performed at execution time with vector member function at, and if a subscript is within the bounds of the array, the member function throws an out_of_bounds exception. Section 7.10 Introduction to C++ Standard Library Class Template vector  Question 5 5 / 5 pts You can sort an array with the Standard Library’s: Which of the following statement is assigning the value 1.667 to array, fractions, element 9? Which statement about exception handling is false? searching probing arranging sorting. 7.7.2 Searching  Question 6 5 / 5 pts It’s an error if an initializer list has more initializers than there are elements in the array. If there are fewer initializers in an initializer list than the number of elements in the array, the remaining elements are initialized to the last value in the initializer list. A given array can store many different types of values. An array subscript should normally be of data type float. 7.3 Declaring arrays  Question 7 5 / 5 pts 13 8 15 10 Section 7.8 Multidimensional arrays  Question 8 5 / 5 pts double nPtr; The process of determining if an array contains a particular key value is called ______________ the array. Which of the following is true? A double subscripted array declared as arrayarrayint, 5, 3 values; has how many elements? Which of the following statement is declaring a pointer nPtr that points to a variable of type double? double* nPtr; double nPtr*; *double nPtr; 8.2.1 Declaring Pointers  Question 9 5 / 5 pts 2003 2012 2024 2006 Section 8.8 Pointer Expressions and Pointer Arithmetic  Question 10 5 / 5 pts A nonconstant pointer to constant data. A nonconstant pointer to nonconstant data. A constant pointer to nonconstant data. A constant pointer to constant data. Section 8.6 Using const with Pointers  Question 11 5 / 5 pts Given that k is an integer array starting at location 2000, kPtr is a pointer to k and each integer is stored in 4 bytes of memory, what location does kPtr + 3 point to? A function that modifies an array by using pointer arithmetic such as ++ptr to process every value of the array should have a parameter that is: Pointers cannot be used to: Manipulate dynamic data structures. Reference values directly. Contain memory addresses. Pass an argument by reference. Section 8.2 Pointer Variable Declarations and Initialization  Question 12 0 / 5 pts You Answered A nonconstant pointer to constant data. Section 8.6 Using const with Pointers A nonconstant pointer to nonconstant data. A constant pointer to nonconstant data. Correct Answer A constant pointer to constant data. Section 8.6 Using const with Pointers  Question 13 5 / 5 pts Returns the total number of bytes in a variable. Usually returns a double. Is a binary operator. Returns the total number of elements in an array. Section 8.7 sizeof Operators  Question 14 5 / 5 pts A pointer that is declared to be of type void* can be dereferenced. What method should be used to pass an array to a function that does not modify the array and only looks at it using array subscript notation: sizeof: Which of the following statement is true? A pointer of one type can be assigned to one of another type without a cast operation. Two pointers that point to different built-in arrays cannot be compared meaningfully. The address operator & can be applied only to constants and to expressions. 8 Pointers  Question 15 5 / 5 pts A nonconstant pointer to nonconstant data. A constant pointer to constant data. A constant pointer to nonconstant data. A nonconstant pointer to constant data. Section 8.6 Using const with Pointers  Question 16 5 / 5 pts ne(superstring, 30, 'n'); ne(superstring, 30, '0'); ne(superstring, 30, 't'); ne(superstring, 30, 's'); Section 8.10 Pointer-Based Strings  Question 17 5 / 5 pts int array c[10]; int c[10]; A function that prints a string by using pointer arithmetic such as ++ptr to output each character should have a parameter that is: ne(superstring, 30); is equivalent to which of the following? Which statement would be used to declare a 10-element integer array c? c = int[10]; array c = int[10]; Section 8.5 Built-In Arrays  Question 18 5 / 5 pts They point to elements of the same array. They point to arrays of the same type. You are trying to compare and perform pointer arithmetic on the values to which they point. They point to arrays of equal size. Section 8.8 Pointer Expressions and Pointer Arithmetic  Question 19 5 / 5 pts A string in C++ is an array of characters ending in the null character ('0'). A string may be assigned in a declaration to either a character array or a variable of type char *. String literals are written inside of single quotes. A string may include letters, digits and various special characters (i.e., +, -, *). Section 8.10 Pointer-Based Strings  Question 20 5 / 5 pts The built-in array’s name is used as an argument in the function call. It always knows the size of the built-in array that is being passed. It is being passed the address of the first element in the built-in array. It is able to modify the values stored in the built-in array. Section 8.5 Built-In Arrays Quiz Score: 90 out of 100 Comparing pointers and performing pointer arithmetic on them is meaningless unless: Which of the following is false for pointer-based strings? Which of the following is false about a function to which a built-in array is being passed? Q5 Due Sep 28 at 12:01pm Points 100 Questions 20 Available until Sep 28 at 12:01pm Time Limit 30 Minutes Allowed Attempts 3 Instructions Attempt History Attempt Time Score KEPT Attempt 2 30 minutes 95 out of 100 LATEST Attempt 2 30 minutes 95 out of 100 Attempt 1 30 minutes 95 out of 100 Score for this attempt: 95 out of 100 Submitted Sep 23 at 10:05pm This attempt took 30 minutes.  Question 1 5 / 5 pts Block scope. Class scope. File scope. Class or block scope, depending on whether the binary scope resolution operator (::) is used. Section 9.4 Class Scope and Accessing Class Members  This quiz covers chapter 9 of the textbook material. Please review the material first before take this test. After you start the test you have 30 minutes to complete it. Take the Quiz Again Variables defined inside a member function of a class have: Question 2 5 / 5 pts The following is a definition of class Example: class Example { public: Example(int y = 10) : data(y) { } int getIncrementedData() const { return ++data; } static int getCount() { cout "Data is " data endl; return count; } private: int data; static int count; }; Assume the following prototype is declared in Time class : void setTime(int, int, int); Assume the following prototype is declared in class Time: void ~Time(int); Assume the following prototype is declared in class Employee: int Employee(string, string); 9.2.7 Time Class Member Function setTime and Throwing Exceptions  Which of the following selection is free of syntax error? Question 3 5 / 5 pts Class C can call class A’s private member functions. Class A can access private variables of class B. Class A is a friend of class C. Class B can access class A’s private variables. Section 9.13 friend Functions and friend Classes  Question 4 5 / 5 pts It performs termination housekeeping. It releases the object’s memory. It is called before the system reclaims the object’s memory. If the programmer does not explicitly provide a destructor, the compiler creates an “empty” destructor. Section 9.6 Destructors  Question 5 5 / 5 pts Until the output buffer is flushed. Only to the current value being displayed. Only to outputs displayed in the current statement. Until explicitly set to a different setting. If the line: friend class A; appears in class B, and the line: friend class B; appears in class C, then: Which of the following is not true of a destructor? Parameterized stream manipulator setfill specifies the fill character that’s displayed when an output is displayed in a field wider than the number of characters or digits in the output. The effect of setfill applies: Section 9.2 Time Class Case Study: Separating Interface from Implementation  Question 6 5 / 5 pts The friendship relationship is neither symmetric nor transitive. A friend declaration can appear anywhere in a class definition. A class can either grant friendship to or take friendship from another class using the friend keyword. A friend of a class can access all of its private data member and member functions. Section 9.13 friend Functions and friend Classes  Question 7 5 / 5 pts increment must be a non-const variable. count must be a non-const variable. count must be a const variable. increment must be a const variable. Section 9.11 const (Constant) Objects and const Member Functions  Question 8 5 / 5 pts Copy and paste that member function’s code into this constructor or member function. This constructor or member function is unnecessary. Which of the following statements about friend functions and friend classes is false? The code fragment: Increment::Increment(int c, int i) : increment (i) { count = c; } does not cause any compilation errors. This tells you that: If a member function of a class already provides all or part of the functionality required by a constructor or another member function then: That member function is unnecessary. Call that member function from this constructor or member function. Section 9.6 Time Class Case Study: Constructors with Default Arguments  Question 9 5 / 5 pts inline public private protect 9 Classes: A Deeper Look  Question 10 5 / 5 pts A predicate function. A utility function. An access function. A constructor. Section 9.5 Access Functions and Utility Functions  Question 11 5 / 5 pts initialized ____________ class members are accessible anywhere an object of the class is in scope. The type of function a client would use to check the balance of a bank account would be: A constant object must be ___________; it cannot be modified after it’s created. assigned provided added 9.11 const Objects and const Member Functions  Question 12 5 / 5 pts Gets a copy of every member function and member variable. Shares pointers to all member variables and member functions. Gets a copy of every member variable. Gets a copy of every member function. Section 9.2 Time Class Case Study: Separating Interface from Implementation  Question 13 5 / 5 pts Does not perform any initialization. Both Is a constructor that must receive no arguments and Is the constructor generated by the compiler when no constructor is provided by the programmer. Is the constructor generated by the compiler when no constructor is provided by the programmer. Is a constructor that must receive no arguments. Section 9.6 Time Class Case Study: Constructors with Default Arguments  Question 14 5 / 5 pts Every object of the same class: A default constructor: Assume that t is an object of class Test, which has member functions a(), b(), c() and d(). If the functions a(), b() and c() all return references to an object of class Test (using the dereferenced this pointer) and function d() returns void, which of the following statements will not produce a syntax error: t.a().t.d(); a().b().t; t.d().c(); t.a().b().d(); Section 9.14 Using the this Pointer  Question 15 0 / 5 pts The client-code programmer is not given T, so the client remains unaware of how Time’s member functions are implemented. The client-code programmer needs to know only Time’s interface to use the class and must be able to link its object code. Correct Answer Often a class’s interface and implementation will be created and compiled by one programmer and used by a separate programmer who implements the client code that uses the class. You Answered To hide the class’s member-function implementation details, the class-implementation programmer would provide the client-code programmer with the header Time.h (which specifies the class’s interface and data members) and the Time object code (i.e., the machine-code instructions that represent Time’s member functions). Section 9.3 Compilation and Linking Process Section 9.3 Compilation and Linking Process  Question 16 5 / 5 pts An object data member is not initialized in the member initialization list. A non-reference, non-const, primitive data member is initialized in the member initialization list. An object data member is not initialized in the member initialization list and does not have a default constructor. An object data member does not have a default constructor. Section 9.12 Composition: Objects as Members of Classes Which of the following statements is false (assume we're referring to class Time)? An error occurs if:  Question 17 5 / 5 pts here this that his 9.14 Using the this Pointer  Question 18 5 / 5 pts You can overload a classes constructors. Just as a constructor can call a class’s other member functions to perform tasks, C++11 allows constructors to call other constructors in the same class. There is no mechanism in C++ for a constructor to call another constructor in the same class. To overload a constructor, provide in the class definition a prototype for each version of the constructor, and provide a separate constructor definition for each overloaded version. Section 9.5 Time Class Case Study: Constructors with Default Arguments  Question 19 5 / 5 pts Both are called automatically, even if they are not explicitly defined in the class. They are both usually called once per object created. They both have the same name aside from the tilde (~) character. An object’s non-static member functions have access to a “self pointer” to the object called the _________ pointer. [C++11]: Which of the following statements is false? Which of the following is not true of a constructor and destructor of the same class? They both are able to have default arguments. Section 9.6 Destructors  Question 20 5 / 5 pts Have class scope. Cannot be changed, even by objects of the same that class. Can be accessed only if an object of that class exists. Can only be changed by static member functions. Section 9.15 static Class Members Quiz Score: 95 out of 100 static data members of a certain class: Q6 Due Oct 5 at 12:01pm Points 100 Questions 20 Available until Oct 5 at 12:01pm Time Limit 30 Minutes Allowed Attempts 3 Instructions Attempt History Attempt Time Score KEPT Attempt 2 30 minutes 100 out of 100 LATEST Attempt 2 30 minutes 100 out of 100 Attempt 1 30 minutes 90 out of 100 Score for this attempt: 100 out of 100 Submitted Sep 30 at 11:59pm This attempt took 30 minutes.  Question 1 5 / 5 pts Having the possibility of leaving a dangling pointer. Allowing the destructor of one object to be called while leaving the second pointer, to the same memory location, intact. Requiring the explicit overloading of the assignment operator. Allowing both objects to point to the same dynamically allocated storage. Section 10.10 Case Study: Array Class  This quiz covers chapter 10 of the textbook material. Please review the material first before take this test. After you start the test you have 30 minutes to complete it. Take the Quiz Again Which of the following is not a disadvantage of default memberwise copy with objects containing pointers?  Quiz submitted  Question 2 5 / 5 pts remove release delete reclaim 10.9 Dynamic Memory Management  Question 3 5 / 5 pts The . operator. The - operator. The & operator. The [ ] operator. Section 10.3 Fundamentals of Operator Overloading  Question 4 5 / 5 pts tor+=(z) y = y operator+= z y operator+=(y + z) y = y + z Section 10.4 Overloading Binary Operators  Question 5 5 / 5 pts The operator ___________ reclaims memory previously allocated by new. Which of the following operators cannot be overloaded? y and z are user-defined objects and the += operator is an overloaded member function. The operator is overloaded such that y += z adds z and y, then stores the result in y. Which of the following expressions is always equivalent to y += z?  Quiz submitted None of the above. Both first and second choice. Make the copy constructor private. Make the overloaded assignment operator private. Section 10.10 Case Study: Array Class  Question 6 5 / 5 pts "CDEF" "EFGHI" "CD" "EF" Section 10.14 Overloading the Function Call Operator ()  Question 7 5 / 5 pts Another reason why you might choose a non-member function to overload an operator is to enable the operator to be commutative. Operator member functions of a specific class are called (implicitly by the compiler) only when the left operand of a binary operator is specifically an object of that class, or when the single operand of a unary operator is an object of that class. When an operator function is implemented as a member function, the leftmost (or only) operand must be an object (or a reference to an object) of the operator's class. To prevent class objects from being copied: Assume that the function call operator() is overloaded for data type String in the usual sense of selecting a substring from a larger string. For a String object string1 with the character string "ABCDEFGHI", what string does string1(4, 2) return? Which statement is false?  Quiz submitted Based on whether an operator is implemented as a member function or as a non-member function, the operator is used differently in expressions. Section 10.11 Operators as Member Function vs. Non-Member Functions  Question 8 5 / 5 pts operator overloading + overloading + operator reuse operator reuse 10.1 Introduction  Question 9 5 / 5 pts string interpolation. a compilation error a string iterator a string-object literal. Section 10.2 Using the Overloaded Operators of Standard Library Class string  Question 10 5 / 5 pts Suppose a and b are integer variables and we form the sum a + b. Now suppose c and d are floatingpoint variables and we form the sum c + d. The two + operators here are clearly being used for different purposes. This is an example of __________________. [C++14]: The code ", have a great day!"s is an example of ________:  Quiz submitted Class string’s overloaded [] operator returns a vector element as an rvalue or an lvalue, depending on the context. Class string provides bounds checking in its member function at. An exception is thrown if the argument to string’s at member function is an invalid subscript. A string can be defined to store any data type. Section 10.2 Using the Overloaded Operators of Standard Library Class string  Question 11 5 / 5 pts assignment (=), address (&), greater and equal to (=) assignment (=), address (&), comma (,) assignment (=),greater and equal to (=), comma (,) greater and equal to (=), address (&), comma (,) 10.3.2 Operators That You Do Not Have to Overload  Question 12 5 / 5 pts operator:+ operator_+ operator(+) operator+ Section 10.3 Fundamentals of Operator Overloading  Question 13 5 / 5 pts Which of the following is false? To use operators on class objects, they must be overloaded, with the exception of operators ________, __________ and __________. The correct function name for overloading the addition (+) operator is: [C++11]: Which of the following is false?  Quiz submitted To receive a list initializer as an argument to a constructor, you can declare the constructor’s parameter as type list_initialierT where T represents the type of the values in the list initializer. To receive a list initializer as an argument to a constructor, you can declare the constructor’s parameter as type initializer_listT where T represents the type of the values in the list initializer. It’s not possible to pass a list initializer to a constructor. First and third choice. Section 10.10 Case Study: Array Class  Question 14 5 / 5 pts The precedence of an operator cannot be changed by overloading. New operators can never be created. Certain overloaded operators can change the number of arguments they take. Overloading cannot change how an operator works on built-in types. Section 10.3 Fundamentals of Operator Overloading  Question 15 5 / 5 pts Specify a return type. Need to be defined inside the class whose objects are being converted. Specify the type that is being converted. Specify the type they convert to. Section 10.12 Converting between Types  Question 16 5 / 5 pts Take a float as an operand. Be used with linked list classes. Which statement about operator overloading is false? The prototypes of overloaded cast operator functions do not: The array subscript operator [], when overloaded, cannot:  Quiz submitted Take multiple values inside (e.g., [4,8]). Take user-defined objects as operands. Section 10.10 Case Study: Array Class  Question 17 5 / 5 pts The pointer needs to know the address of the original data, not a temporary copy of it. Otherwise infinite recursion occurs. The copy of the argument passed by value has function scope. Otherwise the constructor will only make a copy of a pointer to an object. Section 10.10 Case Study: Array Class  Question 18 5 / 5 pts The left operand is an int. The left most operand must be a class object (or a reference to a class object). The operator returns a reference. The overloaded operator is =. Section 10.4 Overloading Binary Operators  Question 19 5 / 5 pts Simply do not declare a copy constructor or assignment operator in the class. Declare as private the class’s copy constructor and overloaded assignment operator or declare the class’s copy constructor and overloaded assignment operator with with = delete after the parameter list. Declare as private the class’s copy constructor and overloaded assignment operator. A copy constructor must receive its argument by reference because: Which situation would require the operator to be overloaded as a non-member function? [C++11]: To prevent class objects from being copied or assigned, you can:  Quiz submitted Declare the class’s copy constructor and overloaded assignment operator with with = delete after the parameter list. Section 10.10 Case Study: Array Class  Question 20 5 / 5 pts Two arrays cannot be meaningfully compared with equality or relational operators. C++ ensures that you cannot “walk off” either end of an array. Arrays cannot be assigned to one another (i.e., array1 = array2;). An entire non-char array cannot be input or output at once. Section 10.10 Case Study: Array Class Quiz Score: 100 out of 100 Which of the following is false?  Quiz submitted

Content preview

Q1
Due Aug 31 at 12:01pm
Points 100
Questions 20
Available until Aug 31 at 12:01pm
Time Limit 30 Minutes
Allowed Attempts Unlimited

Instructions
This quiz covers chapter 1 & 2 of the textbook material. Please review the material first before take this
test. After you start the test you have 30 minutes to complete it.

Take the Quiz Again

Attempt History
Attempt Time Score

KEPT Attempt 2 23 minutes 100 out of 100

LATEST Attempt 2 23 minutes 100 out of 100

Attempt 1 28 minutes 95 out of 100

Score for this attempt: 100 out of 100
Submitted Aug 30 at 10:42pm
This attempt took 23 minutes.

Question 1
pts
Which of the following is not a goal stated by the creator of C++ for the new C++ standard?


Increase compatibility with the C programming language.
Improve library building capabilities.
Make C++ easier to learn.
Correct!
Make C++ an open source programming language.

Section 1.14 C++11 and C++14: The Latest C++ Versions



This study source was downloaded by 100000900703063 from CourseHero.com on 02-12-2026 15:13:57 GMT -06:00


https://www.coursehero.com/file/253845339/Q1-2nd-attempt-CRC-Fa24-CISP-400-LEC-13252-Huangpdf/

,Question 2
pts
The ___________ creates object code and stores it on disk.


Preprocessor.
Correct!
Compiler.
Loader.
Interpreter.

Section 1.9 Typical C++ Development Environment

Question 3
pts
Today, virtually all new major operating systems are written in:


Correct!
C or C++.
Visual C#.
Objective-C.
Ada.

Section 1.7 Programming Languages


Question 4
pts
The size, shape, color and weight of an object are considered __________ of the object’s class.


Correct!
attributes
function
class
reuse

1.8 Introduction to Object Technology


Question 5
pts

This study source was downloaded by 100000900703063 from CourseHero.com on 02-12-2026 15:13:57 GMT -06:00


https://www.coursehero.com/file/253845339/Q1-2nd-attempt-CRC-Fa24-CISP-400-LEC-13252-Huangpdf/

,________ is a graphical language that allows people who design software systems to use an industry
stan¬dard notation to represent them.


The Unified Design Language
None of the above
Correct!
The Unified Modeling Language
The Unified Graphical Language

Section 1.8 Introduction to Object Technology

Question 6
pts
Which of the following statements is false?

Correct!
Global Positioning System (GPS) devices a single satellite to retrieve location-based information.


Electronic health records enable health care providers to share patients’ information across a secure network,
improving patient care, reducing the probability of error and increasing overall efficiency of the health care system.
The Human Genome Project was founded to identify and analyze the 20,000+ genes in human DNA.


Cloud computing allows you to use software, hardware and information stored on remote computers via the Internet
and available on demand—rather than having it stored on your personal computer.

Section 1.2 Computers and the Internet in Industry and Research


Question 7
pts
Computers process data under the control of sets of instructions called
Correct!
programs.
arithmetic and logic unit
central processing unit
secondary storage unit

Ch1


Question 8
5This
/ 5study
ptssource was downloaded by 100000900703063 from CourseHero.com on 02-12-2026 15:13:57 GMT -06:00

https://www.coursehero.com/file/253845339/Q1-2nd-attempt-CRC-Fa24-CISP-400-LEC-13252-Huangpdf/

, C++ programs normally go through six phases— _____, _________, __________, _______, _______,
and _______________.
type, preprocess, compile, link, load, execute
Correct!
edit, preprocess, compile, link, load, execute
type, debug, compile, search, load, execute
type, debug, compile, link, load, execute

1.9 Typical C++ Development Environment

Question 9
pts
Which statement is false?


Classes are reusable software components.
Correct!
A class is an instance of its object.
Section 1.8 Introduction to Object Technology
Performing a task in a program requires a method.
A class is to an object as a blueprint is to a house.

Section 1.8 Introduction to Object Technology


Question 10
pts
________ is a communications protocol used to send information over the web.


TCP/IP
Web 2.0
URL (Uniform Resource Locator).
Correct!
HyperText Transfer Protocol (HTTP).

Section 1.12 Internet and the World Wide Web


Question 11
pts
Which of the following data items are arranged from the smallest to the largest in the data hierarchy.

This study source was downloaded by 100000900703063 from CourseHero.com on 02-12-2026 15:13:57 GMT -06:00


https://www.coursehero.com/file/253845339/Q1-2nd-attempt-CRC-Fa24-CISP-400-LEC-13252-Huangpdf/

Document information

Uploaded on
February 12, 2026
Number of pages
40
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$23.79

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
MindCraft
3.8
(47)
Sold
364
Followers
6
Items
2752
Last sold
1 day ago


Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions