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 49 pages
Exam (elaborations)

Cosumnes River College COMPUTER I CISP400/ CISP 400: All Quizzes 1-6 1at attempt| Answered 2025-26.

Document preview thumbnail
Preview 4 out of 49 pages

Cosumnes River College COMPUTER I CISP400/ CISP 400: All Quizzes 1-6 1at attempt| Answered 2025-26. Q1 Attempt Time Score LATEST Attempt 1 28 minutes 95 out of 100  Question 1 5 / 5 pts open regular self-correcting smart Section 1.15 Boost C++ Libraries  Question 2 5 / 5 pts 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 [C++11]: The Boost Libraries ________ pointers help you avoid some key errors associated with traditional pointers. Which of the following statements is false? This study source was downloaded by from CourseH on :18:29 GMT -06:00 Cloud computing services allow you to increase or decrease resources to meet your needs at any given time, so they can be more cost effective than purchasing expensive hardware to ensure that you have enough storage and processing power to meet your needs at their peak levels. Businesses using cloud computing services must still manage the applications, which can be costly. Cloud computing allows you to use software, hardware and information stored in the “cloud”—i.e., accessed on remote computers via the Internet and available on demand—rather than having it stored on your personal computer. Both first and third choices. Section 1.2 Computers and the Internet in Industry and Research  Question 3 5 / 5 pts Visual C#. Ada. C or C++. Objective-C. Section 1.7 Programming Languages  Question 4 5 / 5 pts Blogging Ajax Mashups RSS Section 1.12 Internet and the World Wide Web  Question 5 5 / 5 pts Today, virtually all new major operating systems are written in: ________ helps Internet-based applications perform like desktop applications. This study source was downloaded by from CourseH on :18:29 GMT -06:00 Web 2.0 HyperText Transfer Protocol (HTTP). TCP/IP URL (Uniform Resource Locator). Section 1.12 Internet and the World Wide Web  Question 6 5 / 5 pts low-level languages, middle-level languages, high-level languages. machine languages, assembly languages, high-level languages. machine languages, assembly languages, C++ languages. low-level languages, assembly languages, high-level languages. Section 1.5  Question 7 5 / 5 pts The source code with the object code. The executable code with primary memory. The object code with the libraries. The primary memory with the CPU. Section 1.9 Typical C++ Development Environment  Question 8 5 / 5 pts ________ is a communications protocol used to send information over the web. The three types of languages discussed in chapter 1 are ______________, __________________and ____________. The linker links: C++ programs normally go through six phases— _____, _________, __________, _______, _______, and _______________. This study source was downloaded by from CourseH on :18:29 GMT -06:00 edit, preprocess, compile, link, load, execute type, debug, compile, link, load, execute type, preprocess, compile, link, load, execute type, debug, compile, search, load, execute 1.9 Typical C++ Development Environment  Question 9 5 / 5 pts Today, most of the code for general-purpose operating systems is written in C or C++. C initially became widely known as the Windows operating system’s development language. With careful design, it’s possible to write C programs that are portable to most computers. C was implemented in 1972 by Dennis Ritchie at Bell Laboratories. Section 1.6 C and C++  Question 10 5 / 5 pts None of the above The Unified Modeling Language The Unified Graphical Language The Unified Design Language Section 1.8 Introduction to Object Technology  Question 11 5 / 5 pts ASCII is a popular subset of Unicode. Fields are composed of characters or bytes. Which of the following statements about the C programming language is false? ________ 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? This study source was downloaded by from CourseH on :18:29 GMT -06:00 The impressive functions performed by computers involve only the simplest manipulations of 1s and 2s. On some operating systems, a file is viewed simply as a sequence of bytes. Section 1.4 Data Hierarchy  Question 12 5 / 5 pts Alpha. Continuous beta. Beta. Release candidate. Section 1.13 Some Key Software Development Terminology  Question 13 5 / 5 pts -, +, %, *, / +, -, /, *, % -, *, %, +, / *, /, %, -, + Section 2.6 Arithmetic  Question 14 0 / 5 pts Which software product release category is "generally feature complete and supposedly bug free, and ready for use by the community?" 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. This study source was downloaded by from CourseH on :18:29 GMT -06:00 std::cout C++ is fun; Correct Answer std::cout "Thisis funrC++ "; You Answered std::cout ""C++ is fun""; Section 2.2 First Program in C++: Printing a Line of Text std::cout '++ is fun'; Section 2.2 First Program in C++: Printing a Line of Text  Question 15 5 / 5 pts _AAA1 my Value m_x width Section 2.3 Modifying Our First C++ Program  Question 16 5 / 5 pts if. greater and or 2.7 Decision Making: Equality and Relational Operators  Question 17 5 / 5 pts Which of the following statements would display the phrase C++ is fun? Which of the following is not a valid C++ identifier? The ________ statement is used to make decisions. hat will be the output after the following C++ statements have been executed? This study source was downloaded by from CourseH on :18:29 GMT -06:00 a b d = c c != d a b c d a != b a b c != d a b c != d Section 2.7 Decision Making: Equality and Relational Operators  Question 18 5 / 5 pts number1 = number2; std::cout number2; sum = number1 + number2; int a{4}; int b{12}; int c{37}; int d{51}; if (a b) { cout "a b" endl; } if (a b) { cout "a b" endl; } if (d = c) { cout "d = c" endl; } if (c != d) { cout "c != d" endl; } Which of the following statements could potentially change the value of number2? This study source was downloaded by from CourseH on :18:29 GMT -06:00 std::cin number2; Section 2.5 Memory Concepts  Question 19 5 / 5 pts left parenthesis ((), right parenthesis ()). left brace ({), right brace (}). less than (), great than (). forward slash and an asterisk (/*), asterisk and a forward slash (*/). 2.2 First Program in C++ ; Printing a Line of Text  Question 20 5 / 5 pts std::cout "hello"; std::cout " there"; std::cout "hello "; std::cout " there"; std::cout "hello" , " there"; std::cout "hello"; std::cout "there"; Section 2.3 Modifying Our First C++ Program Quiz Score: 95 out of 100 A(n) ________ begins the body of every function and a(n) _________ ends the body. Which of the following code segments prints a single line containing hello there with the words separated by a single space? This study source was downloaded by from CourseH on :18:29 GMT -06:00 Q2 Due Sep 7 at 12:01pm Points 100 Questions 20 Available until Sep 7 at 12:01pm Time Limit 30 Minutes Allowed Attempts 3 Instructions Attempt History Attempt Time Score LATEST Attempt 1 30 minutes 100 out of 100 Score for this attempt: 100 out of 100 Submitted Sep 6 at 12:05am This attempt took 30 minutes.  Question 1 5 / 5 pts "Hello" "H" "Hello World!" "Hello World" Section 3.3 Defining a Member Function with a Parameter  This quiz covers chapter 3 & 4 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 Assuming that text is a variable of type string, what will be the contents of text after the statement cin text; is executed if the user types Hello World! then presses Enter? This study source was downloaded by from CourseH on :18:54 GMT -06:00 Question 2 5 / 5 pts get getline getlin to_string 3.2.4 Inputting a string with getline  Question 3 5 / 5 pts Braces. Dot. Parentheses. Comma. Section 3.3 Defining a Member Function with a Parameter  Question 4 5 / 5 pts "llo!!". "ello!". "ello". "llo!". Section 3.8 Validating Data with set Functions  Question 5 5 / 5 pts Function _____________ from the string library reads characters until a newline character is encountered, then copies those characters into the specified string. Two adjacent parameters are separated by what symbol? Assuming that the string object text contains the string "Hello!!! ", the "expression r( 2 , 5 ) would return a string object containing the string: This study source was downloaded by from CourseH on :18:54 GMT -06:00 type, name type, class class, name type, key 3.3.3 Data Member name of Type string  Question 6 5 / 5 pts All of the above are uses that the compiler has for the header file information. Ensuring that each member function knows about the class’s data members and other member functions. Determining the correct amount of memory to allocate for each object of the class. Ensuring that the header of each member function matches its prototype. Section 3.7 Separating Interface from Implementation  Question 7 5 / 5 pts Values. References. Arguments. Objects. Section 3.3 Defining a Member Function with a Parameter  Question 8 5 / 5 pts Constructors. Each parameter in a function header specifies both a(n) _________ and a(n) ___________ . When compiling a class’s source code file (which does not contain a main function), the information in the class’s header file is used for all of the following, except: What is the name of the values the method call passes to the method for the parameters? Attributes of a class are also known as: This study source was downloaded by from CourseH on :18:54 GMT -06:00 Local variables. Classes. Data members. Section 3.4 Data Members, set Member Functions and get Member Functions  Question 9 5 / 5 pts z = ++x + y; z = x++ + y; z = x + ++y; z++ = x + y; 4.13 Increment and Decrement Operators  Question 10 5 / 5 pts x ++ 4; x =+ 4; x += 4; x + 4 = x; Section 4.12 Compound Assignment Operators  Question 11 5 / 5 pts Must contain exactly three statements. Cannot contain declarations. Is a compound statement. Which of the following C++ statement is assigning the sum of the current value of x and y to z and postincrement the value of x? If x initially contains the value 3, which of the following sets x to 7? A block: This study source was downloaded by from CourseH on :18:54 GMT -06:00 Is represented by placing a semicolon (;) where a statement would normally be. Section 4.6 if…else Double-Selection Statement - Blocks  Question 12 5 / 5 pts Declarations. Algorithms. Control structures. Input/output. Section 4.3 Pseudocode  Question 13 5 / 5 pts Implicit conversion. Promotion. Explicit conversion. Section 4.10 Formulating Algorithms: Sentinel-Controlled Iteration Truncation. Section 4.10 Formulating Algorithms: Sentinel-Controlled Iteration  Question 14 5 / 5 pts Pseudocode normally does not include: Which operation does not take place in the following example? int x{21}; double y{6}; double z{14}; y = x / z; x = 5.5 * y; What is the final value of x after performing the following operations? This study source was downloaded by from CourseH on :18:54 GMT -06:00 5. 8.25. 8. 5.5. Section 4.10 Formulating Algorithms: Sentinel-Controlled Iteration  Question 15 5 / 5 pts An algorithm. Program control. Pseudocode. Transfer of control. Section 4.2 Algorithms  Question 16 5 / 5 pts unsigned int counter{10}; All of the above. unsigned int counter = 10; unsigned int counter = {10}; int x{21}; double y{6}; double z{14}; y = x / z; x = 5.5 * y; Specifying the order in which statements are to be executed in a computer program is called: [C++11]: Which of the following statements initializes the unsigned int variable counter to 10? This study source was downloaded by from CourseH on :18:54 GMT -06:00 Section 4.11 Formulating Algorithms: Nested Control Statements  Question 17 5 / 5 pts if…else. do…while. switch. if. Section 4.4 Control Structures- Repetition Statements in C++  Question 18 5 / 5 pts unknown Target Sentinel suggest 4.10 Formulating Algorithms: Sentinel-Controlled Iteration  Question 19 5 / 5 pts Postincrement. Multiplication. Addition. Assignment. Section 4.13 Increment and Decrement Operators  Which of the following is a repetition structure? When it isn’t known in advance how many times a set of statements will be repeated, a(n) _______________ value can be used to terminate the iteration. Which of the following operations has the highest precedence? This study source was downloaded by from CourseH on :18:54 GMT -06:00 Question 20 5 / 5 pts 60 Passed cout "Passed"; nothing. Section 4.5 if Selection Statement Quiz Score: 100 out of 100 If grade has the value of 60, what will the following code display? if (grade = 60) { cout "Passed"; } This study source was downloaded by from CourseH on :18:54 GMT -06:00 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 LATEST Attempt 1 30 minutes 95 out of 100 Score for this attempt: 95 out of 100 Submitted Sep 13 at 12:24am This attempt took 30 minutes.  Question 1 5 / 5 pts Counter-controlled iteration is not possible. The body of the loop will execute at least once. An off-by-one error cannot occur. An infinite loop cannot take place. Section 5.8 do…while Iteration Statement  Question 2 0 / 5 pts 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 If a do…while structure is used: Which of the following for headers is not valid? This study source was downloaded by from CourseH on :20:05 GMT -06:00 for (int i{0}; i 10; i++) You Answered All of the above. Section 5.5 Application: Summing Even Integers Correct Answer for (int i{0}; int j{5}; ; i++) int i{0}; for (; i 10; i++) Section 5.5 Application: Summing Even Integers  Question 3 5 / 5 pts Stops evaluation upon finding one condition to be true. Is a ternary operator. Associates from right to left. Has higher precedence than the AND (&&) operator. Section 5.11 Logical Operators  Question 4 5 / 5 pts char short All of the above. long Section 5.9 switch Multiple-Selection Statement  Question 5 5 / 5 pts The OR (||) operator: Which of the following data types can be used to represent integers? The ____________, __________ and ____________ are the only three forms of control necessary. This study source was downloaded by from CourseH on :20:05 GMT -06:00 sequence, selection, iteration. break, continue, if…else. for, while, do…while. switch, if, else. Section 5.13 Structured Programming Summary  Question 6 5 / 5 pts case1: Case1: Case 1: case 1: Section 5.9 switch Multiple-Selection Statement  Question 7 5 / 5 pts != , () ?: Section 5.11 Logical Operators  Question 8 5 / 5 pts ' (a single quote) * (an asterisk) Which of the following is correct when labeling cases in a switch structure? An operator that associates from right to left is: To make numeric literals more readable, C++14 allows you to insert between groups of digits in numeric literals the digit separator ________________________. This study source was downloaded by from CourseH on :20:05 GMT -06:00 , (a comma) ^ (a caret) Section 6.7 Case Study: Random-Number Generation  Question 9 5 / 5 pts 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. 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. Section 6.4 Function Prototypes  Question 10 5 / 5 pts None of the above. C++ does not provide any capabilities for generating random numbers that cannot be predicted. C++11 provides random number capabilities that can produce nondeterministic random numbers—a set of random numbers that can’t be predicted. Section 6.7 Case Study: Random-Number Generation Random numbers produced by the rand function are nondeterministic. Section 6.7 Case Study: Random-Number Generation  Question 11 5 / 5 pts The function prototype double mySqrt(int x); Which of the following is true? Assuming the following pseudocode for the Fibonacci series, what is the value of the 5th Fibonacci number (fibonacci (5))? fibonacci(0) = 0 fibonacci(1) = 1 fibonacci(n) = fibonacci(n – 1) + fibonacci(n – 2) This study source was downloaded by from CourseH on :20:05 GMT -06:00 1. 3. 7. 5. Section 6.19 Example Using Recursion: Fibonacci Series  Question 12 5 / 5 pts Function template. Macro. Overloaded function. Recursive function. Section 6.17 Function Templates  Question 13 5 / 5 pts enum class Person {ME, YOU, ME};. enum class Person {ME = 1, YOU = 2, THEM = 3};. enum class Person {ME = 0, YOU = 0, THEM = 0};. enum class Person {ME, YOU, THEM};. Section 6.8 Case Study: Game of Chance; Introducing Scoped enums  Question 14 5 / 5 pts The value being passed is small. A pointer to the argument is used. If a set of functions have the same program logic and operations and differ only in the data type(s) each receives as argument(s) then a(n) __________ should be used. Which of the following is not a valid enumeration? Call-by-reference can achieve the security of call-by-value when: This study source was downloaded by from CourseH on :20:05 GMT -06:00 The const qualifier is used. A large argument is passed in order to improve performance. Section 6.13 References and Reference Parameters  Question 15 5 / 5 pts Default values can be constants. When an argument is omitted in a function call, the default value of that argument is automatically inserted by the compiler and passed in the function call. They must be the rightmost (trailing) arguments in a function’s parameter list. Default values cannot be global variables or function calls. Section 6.14 Default Arguments  Question 16 5 / 5 pts One. Three. None. Two. Section 6.14 Default Arguments  Question 17 5 / 5 pts short, long. int, char. float, double. In regards to default arguments, which of the following is false? 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? Converting from type ________ to type ________ will result in the loss of data. This study source was downloaded by from CourseH on :20:05 GMT -06:00 bool, char. Section 6.5 Function-Prototype and Argument Coercion Notes  Question 18 5 / 5 pts Must have unique integer values. Must have unique identifiers. Can be assigned other values once they’ve been defined. Are declared using the keyword const. Section 6.8 Case Study: Game of Chance; Introducing Scoped enums  Question 19 5 / 5 pts Include parameter names. Terminate with a semicolon. Match with all calls to the function. Agree with the function definition. Section 6.5 Function-Prototype and Argument Coercion Notes  Question 20 5 / 5 pts Enumeration constants: A function prototype does not have to: Given the following function template template typename T T maximum(T value1, T value2) { if (value1 value2) { return value1; } else { return value2; This study source was downloaded by from CourseH on :20:05 GMT -06:00 Two error messages. 5 and 5.2. 5 and a type-mismatch error. 2 and 2.3. Section 6.17 Function Templates Quiz Score: 95 out of 100 }} what would be returned by the following two function calls? maximum(2, 5); maximum(2.3, 5.2); This study source was downloaded by from CourseH on :20:05 GMT -06:00 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 LATEST Attempt 1 30 minutes 95 out of 100 Score for this attempt: 95 out of 100 Submitted Sep 20 at 2:03am This attempt took 30 minutes.  Question 1 5 / 5 pts arrayint, 5 n{9, 1, 9}; arrayint, 5 n{0, 7, 0, 3, 8, 2}; arrayint, 5 n{7}; arrayint, 5 n{0, 7, 0, 3, 8}; Section 7.4 Examples Using arrays  Question 2 5 / 5 pts 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 Which of the following is not a correct way to initialize the array named n? The process of determining if an array contains a particular key value is called ______________ the array. This study source was downloaded by from CourseH on :21:18 GMT -06:00 searching sorting. arranging probing 7.7.2 Searching  Question 3 5 / 5 pts for (int item : items) { cout item endl; } for (int i = 0; i (); ++i) { cout items[i] endl; } for (int item : items) { cout items[item] endl; } for (int item : ()){ cout item endl; } Section 7.5 Range-Based for Statement  Question 4 5 / 5 pts Displaying all even element values in an array. Calculating the product of all the values in an array. Accessing the element’s subscript. Incrementing the value stored in each element of the array. Section 7.5 Range-Based for Statement  Assume that the array named items contains the integer values 0, 2, 4, 6 and 8. Which of the following set of statements uses the range-based for loop to display each value in items? Which of the following tasks cannot be performed using a range-based for loop? This study source was downloaded by from CourseH on :21:18 GMT -06:00 Question 5 5 / 5 pts index key preindex postindex subscript 7.3 Declaring arrays  Question 6 5 / 5 pts All of the above initialize all four of the array elements to 0. arrayarrayint, 2, 2 b = {0}; arrayarrayint, 2, 2 b; for (auto &row : b) { for (auto &element : row) { element = 0; } } arrayarrayint,2, 2 b; b[0][0] = b[0][1] = b[1][0] = b[1][1] = 0; Section 7.8 Multidimensional arrays  Question 7 5 / 5 pts what statement. catch block throw block. try statement. Section 7.10 Introduction to C++ Standard Library Class Template vector  The number used to refer to a particular element of an array is called its ______________ Which of the following does not declare a 2-by-2 array and set all four of its elements to 0? When using exception handling, place any code that might throw an exception in a __________. This study source was downloaded by from CourseH on :21:18 GMT -06:00 Question 8 5 / 5 pts Any integer values. Both an address. and nullptr. nullptr. An address. Section 8.2 Pointer Variable Declarations and Initialization  Question 9 5 / 5 pts Storing multiple copies of the same string. Storing an extremely long string. Command-line arguments. Displaying floating-point numbers to the screen. Section 8.11 Arrays of Pointers  Question 10 5 / 5 pts Usually returns a double. Returns the total number of bytes in a variable. Is a binary operator. Returns the total number of elements in an array. Section 8.7 sizeof Operators  Question 11 5 / 5 pts Pointers may be assigned which of the following values? A string array is commonly used for: sizeof: What does the following statement declare? int *countPtr This study source was downloaded by from CourseH on :21:18 GMT -06:00 , count; The declaration is invalid. One pointer to an int and one int variable. Two pointers to ints. Two int variables. Section 8.2 Pointer Variable Declarations and Initialization  Question 12 5 / 5 pts sort(_begin(), _end()); sort(begin(values), end(values)); sort(array_begin(values), array_end(values)); sort((), ()); Section 8.5 Built-In Arrays  Question 13 5 / 5 pts By reference with reference arguments. By reference with pointer arguments. By value with pointer arguments By value. Section 8.4 Pass-by-Reference with Pointers  Question 14 5 / 5 pts A pointer to void without using the cast operator. [C++11]: Given a built-in array of ints named values, which of the following statements would sort the array? Which of the following is not a valid way to pass arguments to a function in C++? A pointer can not be assigned to: This study source was downloaded by from CourseH on :21:18 GMT -06:00 A pointer of a type other than its own type and void without using the cast operator. Another pointer of the same type without using the cast operator. Any other pointer by using the cast operator. Section 8.8 Pointer Expressions and Pointer Arithmetic  Question 15 5 / 5 pts The value 0 is the only integer value that can be assigned directly to a pointer variable without first casting the integer to a pointer type. In the new standard, you should use the constant null_ptr to initialize a pointer instead of 0 or NULL. Prior C++11, the value specified for a null pointer was 0 or NULL. When 0 is assigned to a pointer, it’s converted to a pointer of the appropriate type. Section 8.2 Pointer Variable Declarations and Initialization  Question 16 5 / 5 pts doublePtr = &number1; *doublePtr = &number1; &doublePtr = &number1; doublePtr = number1; 8.2 Pointer Variable Declarations and Initialization  Which of the following statements about pointer initialization and values is false? Which of the following statement is assigning the address of variable number1 to pointer variable doublePtr? Assume that double variables number1 and number2 have been declared and that number1 has been initialized to 7.3. This study source was downloaded by from CourseH on :21:18 GMT -06:00 Question 17 0 / 5 pts Pointer subscript notation. Correct Answer Pointer/offset notation. You Answered Pointer/offset notation where the pointer is actually the name of the array. Section 8.9 Relationship Between Pointers and Built-in Arrays Array subscript notation. Section 8.9 Relationship Between Pointers and Built-in Arrays  Question 18 5 / 5 pts sizeof r / sizeof (int) sizeof (*r) sizeof (*r) / sizeof (int) sizeof r Section 8.7 sizeof Operators  Question 19 5 / 5 pts Consider the following function: void reverse(char *string1, const char *string2) { int stringsize{sizeof(string1)/sizeof(char)}; *(string1 + stringsize – 1) = '0'; string1 = string1 + stringsize – 2; for (; *string2 != '0'; string1--, string2++) { *string1 = *string2; }} What technique does the function use to refer to array elements? Which of the following gives the number of elements in the array int r[10]? Which statement would be used to declare a 10-element integer array c? This study source was downloaded by from CourseH on :21:18 GMT -06:00 int c[10]; array c = int[10]; c = int[10]; int array c[10]; Section 8.5 Built-In Arrays  Question 20 5 / 5 pts variable address integer data 8.1 Introduction Quiz Score: 95 out of 100 A pointer is a variable that contains as its value the ____________ of another variable. This study source was downloaded by from CourseH on :21:18 GMT -06:00 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 LATEST Attempt 1 30 minutes 95 out of 100 Score for this attempt: 95 out of 100 Submitted Sep 23 at 9:30pm This attempt took 30 minutes.  Question 1 5 / 5 pts 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. Class C can call class A’s private member functions. Section 9.13 friend Functions and friend Classes  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 If the line: friend class A; appears in class B, and the line: friend class B; appears in class C, then: Question 2 5 / 5 pts The friendship relationship is neither symmetric nor transitive. A friend of a class can access all of its private data member and member functions. A class can either grant friendship to or take friendship from another class using the friend keyword. A friend declaration can appear anywhere in a class definition. Section 9.13 friend Functions and friend Classes  Question 3 5 / 5 pts increment must be a const variable. increment must be a non-const variable. count must be a non-const variable. count must be a const variable. Section 9.11 const (Constant) Objects and const Member Functions  Question 4 5 / 5 pts 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: Which of the following selection is free of syntax error? 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 class Employee: int Employee(string, string); Assume the following prototype is declared in class Time: void ~Time(int); Assume the following prototype is declared in Time class : void setTime(int, int, int); 9.2.7 Time Class Member Function setTime and Throwing Exceptions  Question 5 0 / 5 pts Given the class definition: Correct Answer constructor called, constructor called, destructor called, destructor called, You Answered constructor called, destructor called, constructor called, destructor called, Section 9.8 When Constructors and Destructors Are Called constructor called, destructor called, constructor called, constructor called, Section 9.8 When Constructors and Destructors Are Called  Question 6 5 / 5 pts his here this that 9.14 Using the this Pointer  class CreateDestroy { public: CreateDestroy() {cout "constructor called, ";} ~CreateDestroy() {cout "destructor called, ";} }; What will the following program output? int main() { CreateDestroy c1; CreateDestroy c2; return 0; } An object’s non-static member functions have access to a “self pointer” to the object called the _________ pointer. Question 7 5 / 5 pts Can access only other static member functions and static data members. Cannot be called until an object of their class is instantiated. Can use the this pointer. Can be declared const as well. Section 9.15 static Class Members  Question 8 5 / 5 pts Nothing. constructor called, constructor called, constructor called, constructor called, destructor called, destructor called, constructor called, destructor called, constructor called, destructor called, Section 9.8 When Constructors and Destructors Are Called  static member functions: Given the class definition: class CreateDestroy { public: CreateDestroy() {cout "constructor called, ";} ~CreateDestroy() {cout "destructor called, ";} }; What will the following program output? int main() { for (int i = 1; i = 2; ++i) { CreateDestroy cd; } return 0; } Question 9 5 / 5 pts Time t3( 22, 40 ); Time t2{ 22, 40 }; All of the above are all valid ways to initialize a Time object. Time t1; Section 9.5 Time Class Case Study: Constructors with Default Arguments  Question 10 5 / 5 pts Invoking a non-const member function on a const object. Declaring an object to be const. Defining a const member function that modifies a data member of the object. Declaring a constructor to be const. Section 9.11 const (Constant) Objects and const Member Functions  Question 11 5 / 5 pts The linker’s output is the executable Time application that users can execute to create and manipulate a Time object. Since the interface of the class is part of the class definition in the Time.h header, the client-code programmer must have access to this file and must #include it in the client’s source-code file. When the client code is compiled, the compiler uses the class definition in Time.h to ensure that the main function creates and manipulates objects of class Time correctly. [C++11]: Assuming the following constructor is provided for class Time explicit Time( int = 0, int = 0, int = 0 ); which of the following is not a valid way to initialize a Time object? Which of the following statements will not produce a syntax error? Which of the following statements is false (assume we're referring to class Time)? Compilers and IDEs typically doesn't invoke the linker for you after compiling your code. Section 9.3 Compilation and Linking Process  Question 12 5 / 5 pts The host object is constructed first and then the member objects are placed into it. Member objects are constructed first, in the order they are declared in the host’s class. Member objects are constructed first, in the order they appear in the host constructor’s initializer list. Member objects are destructed last, in the order they are declared in the host’s class. Section 9.12 Composition: Objects as Members of Classes  Question 13 5 / 5 pts dot (.), dot (.) arrow (-), dot (.) dot (.), arrow (-) arrow (-),arrow (-) 9.4 Class Scope and Accessing Class Members  Question 14 5 / 5 pts Test * const const Test * When composition (one object having another object as a member) is used: Class members are accessed via the __________ operator in conjunction with the name of an object (or reference to an object) of the class or via the ___________ operator in conjunction with a pointer to an object of the class. For a non-constant member function of class Test, the this pointer has type: Test const * const Test * const Section 9.14 Using the this Pointer  Question 15 5 / 5 pts They are both usually called once per object created. They both are able to have default arguments. They both have the same name aside from the tilde (~) character. Both are called automatically, even if they are not explicitly defined in the class. Section 9.6 Destructors  Question 16 5 / 5 pts Shares pointers to all member variables and member functions. Gets a copy of every member function and member variable. Gets a copy of every member function. Gets a copy of every member variable. Section 9.2 Time Class Case Study: Separating Interface from Implementation  Question 17 5 / 5 pts #include #ifndef #define #endif Section 9.2 Time Class Case Study: Separating Interface from Implementation Which of the following is not true of a constructor and destructor of the same class? Every object of the same class: Which of the following preprocessor directives does not constitute part of the preprocessor wrapper?  Question 18 5 / 5 pts Is a constructor that must receive no arguments. 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. Does not perform any initialization. Section 9.6 Time Class Case Study: Constructors with Default Arguments  Question 19 5 / 5 pts It performs termination housekeeping. It is called before the system reclaims the object’s memory. It releases the object’s memory. If the programmer does not explicitly provide a destructor, the compiler creates an “empty” destructor. Section 9.6 Destructors  Question 20 5 / 5 pts Place of birth. Age. The President. Favorite food. Section 9.15 static Class Members Quiz Score: 95 out of 100 A default constructor: Which of the following is not true of a destructor? If Americans are objects of the same class, which of the following attributes would most likely be represented by a static variable of that 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 LATEST Attempt 1 30 minutes 90 out of 100 Score for this attempt: 90 out of 100 Submitted Sep 30 at 11:26pm This attempt took 30 minutes.  Question 1 5 / 5 pts To make the argument list of postincrement include an int. Implicitly done by the compiler. To have the postincrement operator call the preincrement operator. To assign a dummy value to preincrement. Section 10.7 Overloading the Unary Prefix and Postfix ++ and -- Operators  Question 2 5 / 5 pts 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 The conventional way to distinguish between the overloaded preincrement and postincrement operators (++) is: Overloading cannot change how an operator works on built-in types. Certain overloaded operators can change the number of arguments they take. The precedence of an operator cannot be changed by overloading. New operators can never be created. Section 10.3 Fundamentals of Operator Overloading  Question 3 5 / 5 pts precedence, address, “arity” address, associativity, “arity” precedence, associativity, address precedence, associativity, “arity” 10.3.4 Rules and Restrictions on Operator Overloading  Question 4 0 / 5 pts You Answered It’s not possible to pass a list initializer to a constructor. Section 10.10 Case Study: Array Class 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. Correct Answer First and third choice. 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. Section 10.10 Case Study: Array Class Which statement about operator overloading is false? The __________, __________ and _________ of an operator cannot be changed by overloading the operator. [C++11]: Which of the following is false?  Question 5 5 / 5 pts Time::static_cast double() const; Time::operator_cast(double) const; Time::double() const; Time::operator double() const; Section 10.12 Converting between Types  Question 6 5 / 5 pts release reclaim delete remove 10.9 Dynamic Memory Management  Question 7 5 / 5 pts Date Date::operator++(int) { Increment(); Date temp{*this}; return temp; } Which of the following lines would be the prototype for an overloaded cast operator function that converts an object of user-defined type Time into a double? The operator ___________ reclaims memory previously allocated by new. There exists a data type Date with member function Increment that increments the current Date object by one. The ++ operator is being overloaded to postincrement an object of type Date. Select the correct implementation: Date Date::operator++(int) { Date temp{*this}; Increment(); return temp; } Date Date::operator++(int) { Date temp{*this}; return this; temp.Increment(); } Date Date::operator++(int) { Date temp{*this}; Increment(); return *temp; } Section 10.8 Case Study: A Date Class  Question 8 5 / 5 pts Can convert between user-defined types. Are implicitly defined by the compiler if not explicitly written by the programmer. Cannot convert built-in types to user defined types. Can have multiple arguments. Section 10.12 Converting between Types  Question 9 5 / 5 pts Can be implicitly called by the compiler to perform a data type conversion. Must take exactly one argument. Cannot be called outside of the class it is declared in. Conversion constructors: An explicit constructor: Does not initialize its class’s data members. Section 10.13 explicit Constructors and Conversion Operator  Question 10 5 / 5 pts y operator+=(y + z) tor+=(z) y = y operator+= z y = y + z Section 10.4 Overloading Binary Operators  Question 11 5 / 5 pts operator operator overload overload overload function 10.3.4 Rules and Restrictions on Operator Overloading  Question 12 5 / 5 pts Must be told which destructor to call when destroying an object. Can delete an entire array of objects declared using new. Is called implicitly at the end of a program. Can terminate the program. Section 10.9 Dynamic Memory Management 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? Keyword _______________ introduces an overloaded-operator function definition. The delete [] operator:  Question 13 5 / 5 pts When a unique_ptr goes out of scope, its destructor automatically returns the managed memory to the free store. A unique_ptr is a “smart pointer” for managing dynamically allocated memory. All of the above. You must explicitly delete the memory that’s managed by a unique_ptr before the object goes out of scope. Section 10.9 Dynamic Memory Management  Question 14 5 / 5 pts Otherwise the constructor will only make a copy of a pointer to an object. The copy of the argument passed by value has function scope. The pointer needs to know the address of the original data, not a temporary copy of it. Otherwise infinite recursion occurs. Section 10.10 Case Study: Array Class  Question 15 5 / 5 pts It returns a pointer. It automatically destroys the object after main is exited. It calls the object’s constructor. It does not require the size of the object to be explicitly specified in the new expression. Section 10.9 Dynamic Memory Management  Question 16 5 / 5 pts Which of the following statements about a unique_ptr object is false? A copy constructor must receive its argument by reference because: Which of the following is false about the new operator and the object for which it allocates memory? operator(+) operator+ operator_+ operator:+ Section 10.3 Fundamentals of Operator Overloading  Question 17 5 / 5 pts ostream operator(const Data& dataToPrint, ostream& output) ostream& operator(const Data& dataToPrint, ostream& output) ostream& operator(ostream& output, const Data& dataToPrint) ostream operator(ostream& output, const Data& dataToPrint) Section 10.5 Overloading the Binary Stream Insertion and Stream Extraction Operators  Question 18 5 / 5 pts Specify a return type. Specify the type they convert to. Need to be defined inside the class whose objects are being converted. Specify the type that is being converted. Section 10.12 Converting between Types  Question 19 0 / 5 pts The correct function name for overloading the addition (+) operator is: Suppose you have a programmer-defined data type Data and want to overload the operator to output your data type to the screen in the form cout dataToPrint; and allow cascaded function calls. The first line of the function definition would be: The prototypes of overloaded cast operator functions do not: [C++11]: To prevent class objects from being copied or assigned, you can: Simply do not declare a copy constructor or assignment operator in the class. Correct Answer 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. You Answered Declare the class’s copy constructor and overloaded assignment operator with with = delete after the parameter list. Section 10.10 Case Study: Array Class Declare as private the class’s copy constructor and overloaded assignment operator. Section 10.10 Case Study: Array Class  Question 20 5 / 5 pts Is a constructor that initializes a newly declared object to the value of an existing object of the same class. . None of the above Is a constructor that takes no arguments. Is a constructor with only default arguments. Section 10.10 Case Study: Array Class Quiz Score: 90 out of 100 A copy constructor:

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

LATEST Attempt 1 28 minutes 95 out of 100

Score for this attempt: 95 out of 100
Submitted Aug 30 at 10:17pm
This attempt took 28 minutes.

Question 1
pts
[C++11]: The Boost Libraries ________ pointers help you avoid some key errors associated with
traditional pointers.


open
regular
self-correcting
Correct!
smart

Section 1.15 Boost C++ Libraries


Question 2
pts
Which of the following statements is false?
This study source was downloaded by 100000900703063 from CourseHero.com on 02-12-2026 15:18:29 GMT -06:00


https://www.coursehero.com/file/253845344/Q1-CRC-Fa24-CISP-400-LEC-13252-Huangpdf/

,Cloud computing services allow you to increase or decrease resources to meet your needs at any given time, so they
can be more cost effective than purchasing expensive hardware to ensure that you have enough storage and
processing power to meet your needs at their peak levels.
Correct!
Businesses using cloud computing services must still manage the applications, which can be costly.


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


Both first and third choices.

Section 1.2 Computers and the Internet in Industry and Research

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


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

Section 1.7 Programming Languages


Question 4
pts
________ helps Internet-based applications perform like desktop applications.


Blogging
Correct!
Ajax
Mashups
RSS

Section 1.12 Internet and the World Wide Web


Question 5
pts
This study source was downloaded by 100000900703063 from CourseHero.com on 02-12-2026 15:18:29 GMT -06:00


https://www.coursehero.com/file/253845344/Q1-CRC-Fa24-CISP-400-LEC-13252-Huangpdf/

,________ is a communications protocol used to send information over the web.


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

Section 1.12 Internet and the World Wide Web

Question 6
pts
The three types of languages discussed in chapter 1 are ______________, __________________and
____________.
low-level languages, middle-level languages, high-level languages.
Correct!
machine languages, assembly languages, high-level languages.
machine languages, assembly languages, C++ languages.
low-level languages, assembly languages, high-level languages.

Section 1.5


Question 7
pts
The linker links:


The source code with the object code.
The executable code with primary memory.
Correct!
The object code with the libraries.
The primary memory with the CPU.

Section 1.9 Typical C++ Development Environment


Question 8
pts
C++ programs normally go through six phases— _____, _________, __________, _______, _______,
and _______________.
Correct!
This study source was downloaded by 100000900703063 from CourseHero.com on 02-12-2026 15:18:29 GMT -06:00


https://www.coursehero.com/file/253845344/Q1-CRC-Fa24-CISP-400-LEC-13252-Huangpdf/

, edit, preprocess, compile, link, load, execute
type, debug, compile, link, load, execute
type, preprocess, compile, link, load, execute
type, debug, compile, search, load, execute

1.9 Typical C++ Development Environment

Question 9
pts
Which of the following statements about the C programming language is false?


Today, most of the code for general-purpose operating systems is written in C or C++.
Correct!
C initially became widely known as the Windows operating system’s development language.
With careful design, it’s possible to write C programs that are portable to most computers.
C was implemented in 1972 by Dennis Ritchie at Bell Laboratories.

Section 1.6 C and C++


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


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

Section 1.8 Introduction to Object Technology


Question 11
pts
Which of the following statements is false?


ASCII is a popular subset of Unicode.
Fields are composed of characters or bytes.
Correct!
This study source was downloaded by 100000900703063 from CourseHero.com on 02-12-2026 15:18:29 GMT -06:00


https://www.coursehero.com/file/253845344/Q1-CRC-Fa24-CISP-400-LEC-13252-Huangpdf/

Document information

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

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