Midterm 3

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

The components of a class are called the ____ of the class.

members

*Which executes first in a do...while loop?

*The statement

Given the following function: int strange(int x, int y) { if (x > y) return x + y; else return x - y; } what is the output of the following statement? printf("%d\n", strange(4, 5));

-1

What is the output of the following C++ code? num = 10; while (num > 10) num = num - 2; cout << num << endl;

10

Suppose sum and num are int variables, and the input is 18 25 61 6 -1. What is the output of the following code? sum = 0; cin >> num; while (num != -1) { sum = sum + num; cin >> num; } cout << sum << endl;

110

Suppose j, sum, and num are int variables, and the input is 26 34 61 4 -1. What is the output of the code? sum = 0; cin >> num; for (int j = 1; j <= 4; j++) { sum = sum + num; cin >> num; } cout << sum << endl;

125

Assume all variables are properly declared. What is the output of the following C++ code? num = 100; while (num <= 150) num = num + 5; cout << num << endl;

155

Consider the following definition of the recursive function mystery . int mystery(int first, int last) { if (first > last) return 0; else if (first == last) return first; else return first + mystery(first + 1, last - 1); } What is the output of the following statement? cout << mystery(6, 10) << endl;

21

What is the output of the following C++ code? count = 1; num = 25; while (count < 25) { num = num - 1; count++; } cout << count << " " << num << endl;

25 1

Consider the accompanying definition of the recursive function mystery. Given the declaration: int alpha[5] = {1, 4, 5, 8, 9}; what is the output of the following statement? cout << mystery(alpha, 0, 4) << endl;

27

What is the next Fibonacci number in the following sequence? 1, 1, 2, 3, 5, 8, 13, 21, ...

34

int puzzle(int start, int end) { if (start > end) return start - end; else if (start == end) return start + end; else return end * puzzle(start + 1, end - 1); } Consider the accompanying definition of a recursive function. What is the output of the following statement? cout << puzzle(3, 7) << endl;

42

Consider the following definition of the recursive function mystery. int mystery(int num) { if (num <= 0) return 0; else if (num % 2 == 0) return num + mystery(num - 1); else return num * mystery(num - 1); } What is the output of the following statement? cout << mystery(5) << endl;

50

The statement: return 37, y, 2 * 3; returns the value ____.

6

What value is returned by the following return statement? int x = 5; return x + 1;

6

Consider the accompanying definition of the recursive function mystery. Given the declaration: int beta[10] = {2, 5, 8, 9, 13, 15, 18, 20, 23, 25}; What is the output of the following statement? cout << mystery(beta, 4, 7) << endl;

66

int puzzle(int start, int end) { if (start > end) return start - end; else if (start == end) return start + end; else return end * puzzle(start + 1, end - 1); } Consider the accompanying definition of a recursive function. What is the output of the following statement? cout << puzzle(5, 10) << endl;

720

int recFunc(int num) { if (num >= 10) return 10; else return num * recFunc(num + 1); } Consider the accompanying definition of a recursive function. What is the output of the following statement? cout << recFunc(8) << endl;

720

The output of the statement: printf("%f\n", pow(2.0, pow(3.0, 1.0))); is ____.

8.0

Assume the following. static_cast('a') = 97 static_cast('A') = 65 The output of the statement: cout << static_cast(tolower('B')) << endl; is ____

98

The standard header file for the abs(x) function is ____.

<cstdlib>

A ____ sign in front of a member name on the UML diagram indicates that this member is a public member. a. + b. - c. # d. $

A

Given the function prototype: double testAlpha(int u, char v, double t); which of the following statements is legal? a. printf("%lf", testAlpha(5, 'A', 2)); b. printf("%lf", testAlpha( int 5, char 'A', int 2)); c. printf("%lf", testAlpha('5.0', 'A', '2.0')); d. printf("%lf", testAlpha(5.0, "65", 2.0));

A

Suppose sum, num, and j are int variables, and the input is 4 7 12 9 -1. What is the output of the following code? cin » sum; cin » num; for (j = 1; j <= 3; j++) { cin » num; sum = sum + num; } cout « sum « endl; a. 24 b. 25 c. 41 d. 42

A

The output of the statement: Printf("%c\n", tolower('$'); is ____. a. '$' b. '0' c. '1' d. An error, because you cannot use tolower with '$'.

A

What is the output of the following program? #include < iostream > using namespace std; void one(int x, int& y); void two(int& s, int t); int main() { int u = 1; int v = 2; one(u, v); cout << u << " " << v << endl; two(u, v); cout << u << " " << v << endl; return 0; } void one(int x, int& y) { int a; a = x; x = y; y = a; } void two(int& s, int t) { int b; b = s - t; s = t + b + 2; t = 4 * b; } a. 1 1 3 1 b. 1 2 1 3 c. 1 2 2 3 d. 2 2 2 3

A

Which executes first in a do ... while loop? a. statement b. loop condition c. initial statement d. update statement

A

Which of the following class definitions is correct in C++? a. class studentType { public: void setData(string, double, int); private: string name; }; b. class studentType { public: void setData(string, double, int); void print() const; private: string name; double gpa; } c. class studentType { public void setData(string, double, int); private string name; }; d. studentType class { public: void setData(string, double, int); private: string name; };

A

Which of the following function prototypes is valid? a. int funcExp(int x, float v); b. funcExp(int x, float v){}; c. funcExp(void); d. int funcExp(x);

A

Which of the following is a legal C++ function definition? a. void funcTest(int& u, double& v) { cout << u << " " << v << endl; } b. void funcTest(int& u, double& v); { cout << u << " " << v << endl; } c. void funcTest(int& u, double& v) ( cout << u << " " << v << endl ) d. void funcTest(int& u, double& v) [ cout << u << " " << v << endl; ]

A

Which of the following is true about classes and structs? a. By default, all members of a struct are public and all members of a class are private. b. A struct variable is passed by value only, and a class variable is passed by reference only. c. An assignment operator is allowed on class variables, but not on struct variables. d. You cannot use the member access specifier private in a struct.

A

Which of the following solution methods would be the best choice for a mission control system? a. Iterative b. Direct recursive c. Indirect recursive d. Infinite recursive

A

Which of the following solutions is easier to construct for the Tower of Hanoi problem? a. Recursive c. Procedural b. Iterative d. Step-by-step

A

____ control structures use a looping structure, such as while , for , or do. ..while , to repeat a set of statements. a. Iterative b. Recursive c. Procedural d. Object

A

A ____ sign in front of a member name on the UML diagram indicates that this member is a private member. a. + b. - c. # d. $

B

Consider the accompanying class definition, and the object declaration: rectangleType bigRect(14,10); Which of the following statements is correct? a. bigRect.setLengthWidth(); b. bigRect.setLengthWidth(3.0, 2.0); c. bigRect.length = 2.0; d. bigRect.length = bigRect.width;

B

Given the following function prototype: double tryMe(double, double);, which of the following statements is valid? Assume that all variables are properly declared. a. scanf("%lf", &tryMe(x)); b. printf("%lf", tryMe(2.0, 3.0)); c. printf("%lf", tryMe(tryMe(double, double), double)); d. printf("%lf", tryMe(tryMe(float, float), float));

B

Given the following function prototype: int myFunc(int, int);, which of the following statements is valid? Assume that all variables are properly declared. a. scanf("%d", &myFunc(y)); b. printf("%d", myFunc(myFunc(7, 8), 15)); c. scanf("%d", myFunc('2', '3')); d. printf("%d", myFunc(myFunc(7), 15));

B

Suppose j, sum, and num are int variables, and the input is 26 34 61 4 -1. What is the output of the code? sum = 0; cin » num; for (int j = 1; j <= 4; j++) { sum = sum + num; cin » num; } cout « sum « endl; a. 124 b. 125 c. 126 d 127

B

Suppose that printHeading is a function without any parameters. Which of the following is a valid function heading? a. void printHeading(); b. void printHeading() c. void printHeading(noParameters); d. void printHeading(void)

B

Suppose that you are given the following function definition: void printSomeThing(int x) { for (int i = 1; i <= x, i++) cout << "* "; cout << endl; } What is the output of the following statements? printSomeThing(1); printSomeThing(2); printSomeThing(3); a. ****** b. * * * * * * c. * * * * * * d. * * * * * * * * * *

B

There are two types of ____ parameters: value parameters and reference parameters. a. actual b. formal c. active d. passiv

B

Which statement below about prototypes and headers is true? a. Parameter names must be listed in the prototype, but not necessarily in the header. b. Prototypes end with a semicolon, but headers do not. c. Headers should come before prototypes. d. Headers end with a semicolon, but prototypes do not

B

int foo(int n) //Line 1 { //Line 2 if (n == 0) //Line 3 return 0; //Line 4 else //Line 5 return n + foo(n - 1); //Line 6 } //Line 7 Consider the accompanying definition of a recursive function. Which of the statements represents the base case? a. Statements in Lines 1-6. b. Statements in Lines 3 and 4. c. Statements in Lines 5 and 6. d. Statements in Lines 3, 4, and 5.

B

A ____ sign in front of a member name on the UML diagram indicates that this member is a protected member. a. + b. - c. # d. $

C

A function prototype is ____. a. a definition, but not a declaration b. a declaration and a definition c. a declaration, but not a definition d. a comment line

C

Consider the accompanying class definition, and the declaration: rectangleType bigRect; Which of the following statements is correct? a. rectangleType.print(); b. rectangleType::print(); c. bigRect.print(); d. bigRect::print();

C

Consider the following code. (Assume that all variables are properly declared.) cin >> ch; while (cin) { cout << ch; cin >> ch; } This code is an example of a(n) ____ while loop. Select one: a. sentinel-controlled b. flag-controlled c. EOF-controlled d. counter-controlled

C

Consider the following definition of the recursive function print . void print(int num) { if (num > 0) { cout << num << " "; print(num - 1); } } What is the output of the following statement? print(4); a. 0 1 2 3 4 b. 1 2 3 4 c. 4 3 2 1 d. 4 3 2 1 0

C

Given the following function prototype: int test(float, char);, which of the following statements is valid? a. printf("%d", test(12, &)); b. printf("%d", test("12.0", '&')); c. int u = test(5.0, '*'); d. printf("%d", test('12', '&'));

C

Given the following function: int next(int x) { return (x + 1); } what is the output of the following statement? printf("%d\n", next(next(5))); a. 5 c. 7 b. 6 d. 8

C

What is the output of the following C++ code? int alpha = 5; int beta = 10; alpha = alpha + 5; { int alpha = 20; beta = beta + 5; } cout << alpha << " " << beta << endl; a. 10 10 b. 20 15 c. 10 15 d. 15 10

C

What is the output of the following C++ code? int j; for (j = 10; j <= 10; j++) cout « j « " "; cout « j « endl; a. 10 b. 10 10 c. 10 11 d. 11 11

C

Which of the following loops does not have an entry condition? a. BOF-controlled while loop b. sentinel-controlled while loop c. do ... while loop d. for loop

C

Which of the following loops is guaranteed to execute at least once? a. counter-controlled while loop b. for loop c. do ... while loop d. sentinel-controlled while loop

C

Which of the following rules should you follow to solve the Tower of Hanoi problem? a. Only two disks can be moved at a time. b. You can remove disks only from the first needle. c. The removed disk must be placed on one of the needles d. A larger disk can be placed on top of a smaller disk.

C

class rectangleType { public: void setLengthWidth(double x, double y); //Postcondition: length = x; width = y; void print() const; //Output length and width; double area(); //Calculate and return the area of the rectangle; double perimeter(); //Calculate and return the parameter; rectangleType(); //Postcondition: length = 0; width = 0; rectangleType(double x, double y); //Postcondition: length = x; width = y; private: double length; double width; }; Consider the accompanying class definition. Which of the following class variable declarations is correct? a. rectangle rectangleType; b. class rectangleType rectangle; c. rectangleType rectangle; d. rectangle rectangleType.area;

C

Consider the following code. int limit; int counter = 0; cin >> limit; while (counter < limit) { cin >> entry; triple = entry * 3; cout << triple; counter++; } cout << endl; This code is an example of a(n) ____ while loop.

Counter Controlled

Consider the following function definition. void strange(int& u, char& ch) { int a; a = u++; u = 2 * u; a = static_cast(ch); a++; ch = static_cast(a); } What are the values of one and letter after the following statements execute? int one =5; char letter = 'A'; strange(one, letter); a. one = 5; letter = 'A' b. one = 10; letter = 'A' c. one = 10; letter = 'B' d. one = 12; letter = 'B'

D

Given the function prototype: float test(int, int, int); which of the following statements is legal? a. printf("%f", test(7, test(14, 23))); b. printf("%f", test(test(7, 14), 23)); c. printf("%f", test(14, 23)); d. printf("%f", test(7, 14, 23));

D

In C++, the scope resolution operator is ____. a. | b. . c. : d. ::

D

In C++, you can pass a variable by reference and still prevent the function from changing its value, by using the keyword ____ in the formal parameter declaration. a. automatic b. private c. static d. const

D

Suppose that you have the following function. void mystery(int& one, int two) { int temp temp = one; one = two; two = temp; } What are the values of x and y after the following statements? (Assume that variables are properly declared.) x = 10; y = 15; mystery(x, y); a. x = 10; y = 10 b. x = 10; y = 15 c. x = 15; y = 10 d. x = 15; y = 15

D

The output of the statement: printf("%f\n", pow(3.0, 2.0) + 5); is ____. a. 11.0 c. 13.0 b. 12.0 d. 14.0

D

What is the value of x after the following statements execute? int x = 5; int y = 30; do x = x * 2; while (x < y); a. 5 b. 10 c. 20 d. 40

D

Which of the following function headings can be used for a recursive definition of a function to calculate the nth Fibonacci number? a. void rFibNum(int a, int b) b. bool rFibNum(int a, int b) c. bool rFibNum(int a, int b, int n) d. int rFibNum(int a, int b, int n)

D

Which of the following function prototypes is valid? a. int funcTest(int x, int y, float z){} b. funcTest(int x, int y, float){}; c. int funcTest(int, int y, float z) d. int funcTest(int, int, float);

D

Which of the following is not a function of the break statement? a. To exit early from a loop b. To skip the remainder of a switch structure c. To eliminate the use of certain bool variables in a loop d. To ignore certain values for variables and continue with the next iteration of a loop

D

void printNum(int num) //Line 1 { //Line 2 if (n < 0) //Line 3 cout << "Num is negative" << endl; //Line 4 else if (num == 0) //Line 5 cout << "Num is zero" << endl; //Line 6 else //Line 7 { //Line 8 cout << num << " "; //Line 9 printNum(num - 1); //Line 10 } //Line 11 } Consider the accompanying definition of a recursive function. Which of the statements represent the general case? a. Statements in Lines 3-11 b. Statements in Lines 5-6 c. Statements in Lines 5-11 d. Statements in Lines 7-11

D

A syntax error will result if the control statements of a for loop are omitted.

False

An EOF-controlled while loop is another name for a sentinel-controlled while loop.

False

In a sentinel-controlled while loop, the body of the loop continues to execute until the EOF symbol is read. Select one: True False

False

In the Tower of Hanoi recursive program, if needle 1 contains three disks, then the number of moves required to move all three disks from needle 1 to needle 3 is 8.

False

In the for statement, if the loop condition is omitted, it is assumed to be false.

False

It is possible that the body of a while loop may not execute at all, but the body of a for loop executes at least once. Select one: True False

False

Loop control variables are automatically initialized in a loop. Select one: True False

False

The body of a do...while loop may not execute at all.

False

The following is an example of a recursive function, where nextNum is a function such that nextNum(x) = x + 1. int recFunc(int x) { return nextNum(nextNum(x)); }

False

The following while loop terminates when j > 20. j = 0; while (j < 20)

False

(T/F) As parameters to a function, class objects can be passed by reference only.

False.

(T/F) Given the declaration. class myClass { public: void print(); //Output the value of x; MyClass(); private: int x; }; myClass myObject; The following statement is legal. myObject.x = 10;

False.

(T/F) If an object is created in a user program, then the object can access both the public and private members of the class.

False.

(T/F) If the formal parameter list of a function is empty, the parentheses after the function name are not needed.

False.

(T/F) If the heading of a member function of a class ends with the word const , then the function member cannot modify the private member variables, but it can modify the public member variables.

False.

(T/F) In the Tower of Hanoi recursive program, if needle 1 contains three disks, then the number of moves required to move all three disks from needle 1 to needle 3 is 8.

False.

(T/F) Infinite recursions execute forever on a computer.

False.

(T/F) The execution of a return statement in a user-defined function terminates the program.

False.

(T/F) The following return statement returns the value 10 . return 10, 16;

False.

(T/F) The function main is always compiled first, regardless of where in the program the function main is placed.

False.

(T/F) With recursion, the base case must eventually be reduced to a general case.

False.

(T/F) You can use arithmetic operators to perform arithmetic operations on class objects.

False.

When a continue statement is executed in a ____, the update statement always executes.

For loop

A loop that continues to execute endlessly is called a(n) ____ loop.

Infinite

____________________ identifiers are not accessible outside of the function (block).

Local

What executes immediately after a continue statement in a while and do-while loop?

Loop Continue Test

____ parameters are useful when you want to return more than one value from a function.

Reference

void printNum(int num) //Line 1 { //Line 2 if (n < 0) //Line 3 cout << "Num is negative" << endl; //Line 4 else if (num == 0) //Line 5 cout << "Num is zero" << endl; //Line 6 else //Line 7 { //Line 8 cout << num << " "; //Line 9 printNum(num - 1); //Line 10 } //Line 11 } //Line 12 Consider the accompanying definition of a recursive function. Which of the statements represent the base case?

Statements in Lines 3-6

What is the output of the following loop? count = 5; cout << 'St'; do { cout << 'o'; count--; } while (count <= 5);

This is an infinite loop.

(T/F) You can use a recursive algorithm to find the largest element in an array.

True

A for loop is typically called an indexed for loop.

True

A loop is a control structure that allows you to repeat a set of statements until certain conditions are met. Select one: True False

True

A sentinel-controlled while loop is an event-controlled while loop whose termination depends on a special value. Select one: True False

True

After a break statement executes, the program continues to execute with the first statement after the structure.

True

After a break statement executes, the program continues to execute with the first statement after the structure. Select one: True False

True

An infinite loop may execute indefinitely.

True

Assume all variables are properly declared. The output of the following C++ code is 2 3 4 5. n = 1; while (n < 5) { n++; cout << n << " "; } Select one: True False

True

Both while and for loops are pre-test loops.

True

If a continue statement is placed in a do...while structure, the loop-continue test is evaluated immediately after the continue statement.

True

In a counter-controlled while loop, the loop control variable must be initialized before the loop. Select one: True False

True

In a recursive function, the base case stops the recursion.

True

In the case of the sentinel-controlled while loop, the first item is read before the while loop is entered.

True

In the case of the sentinel-controlled while loop, the first item is read before the while loop is entered. Select one: True False

True

The control statements in the for loop include the initial statement, loop condition, and update statement.

True

The control variable in a flag-controlled while loop is a bool variable.

True

The control variable in a flag-controlled while loop is a bool variable. Select one: True False

True

The do...while loop has an exit condition but no entry condition.

True

The execution of a break statement in a while loop terminates the loop. Select one: True False

True

The following is a valid recursive definition to determine the factorial of a non-negative integer. 0! = 1 1! = 1 n! = n * (n - 1)! if n > 0

True

The fourth number in a Fibonacci sequence is found by taking the sum of the previous two numbers in the sequence.

True

The function eof returns true if the program has read past the end of the input file

True

The function eof returns true if the program has read past the end of the input file. Select one: True False

True

The number of iterations of a counter-controlled loop is known in advance.

True

To design a recursive function, you must determine the limiting conditions.

True

(T/F) A class is an example of a structured data type.

True.

(T/F) Assume that all variables are properly declared. The following statement in a value-returning function is legal. if (x % 2 == 0) return x; else return x + 1;

True.

(T/F) Every call to a recursive function requires the system to allocate memory for the local variables and formal parameters.

True.

(T/F) If an object is declared in the definition of a member function of the class, then the object can access both the public and private members of the class.

True.

(T/F) In C++ terminology, a class object is the same as a class instance.

True.

(T/F) In C++, a function prototype is the function heading without the body of the function.

True.

(T/F) In C++, class is a reserved word and it defines only a data type.

True.

(T/F) In a recursive function, the base case stops the recursion

True.

(T/F) Once you write and properly debug a function, you can use it in the program (or different programs) again and again without having to rewrite the same code repeatedly.

True.

(T/F) The data type of a variable in a return statement must match the function type.

True.

(T/F) The following function heading in a C++ program is valid: int funcExp(int u, char v, float g)

True.

(T/F) The following is a valid recursive definition to determine the factorial of a non-negative integer. 0! = 1 1! = 1 n! = n * (n - 1)! if n > 0

True.

(T/F) The following is an example of a recursive function. void print(int x) { if (x > 0) { cout << x << " " ; print (x - 1); } }

True.

(T/F) Using functions greatly enhances a program's readability because it reduces the complexity of the function main.

True.

A member function of a class that only accesses the value(s) of the data member(s) is called a(n) ____ function.

accessor

When a function is called, the value of the ____ parameter is copied into the corresponding formal parameter.

actual

A variable or expression listed in a call to a function is called the ____.

actual parameter

The ____ case is the case for which the solution to an equation is obtained directly.

base

The recursive algorithm must have one or more base cases, and the general solution must eventually be reduced to a(n) ____________________.

base case

A(n) ____-controlled while loop uses a bool variable to control the loop. Select one: a. counter b. sentinel c. flag d. EOF

c. flag

To guarantee that the member variables of a class are initialized, you use ____.

constructors

The ____ statement can be used to eliminate the use of certain bool variables in a loop. Select one: a. if b. while c. switch d. break

d. break

A function is called ____ if it calls itself.

directly recursive

____ loops are called post-test loops.

do - while

The program that tests a function is called a(n) ____________________ program.

driver

When a continue statement is executed in a __ ' the update statement always executes.

for loop

A variable listed in a header is known as a(n) ____ parameter.

formal parameter

During program execution, a(n) ____ parameter manipulates the data stored in its own memory space.

formal value

The ____________________ Fibonacci number in a sequence is the sum of the second and third Fibonacci numbers.

fourth

The heading of the function is also called the ____.

function header

If a function of a class is static, it is declared in the class definition using the keyword static in its ____.

heading

Which of the following is the initial statement in the following for loop? (Assume that all variables are properly declared.) int i; for (i = 1; i < 20; i++) cout << "Hello World"; cout << "!" << endl;

i=1

Tracing through ____ recursion is more tedious than tracing other recursive forms.

indirect

If you execute an infinite recursive function on a computer, the function executes until the system runs out of ____________________.

memory

If a member of a class is ____, you cannot access it outside the class.

private

A definition in which something is defined in terms of a smaller version of itself is called a(n) ____ definition.

recursive

Recursive algorithms are implemented using ____________________ functions.

recursive

A(n) ____________________ parameter is a formal parameter that receives the location (memory address) of the corresponding actual parameter.

reference

When you attach & after the dataType in the formal parameter list of a function, the variable following that dataType becomes a(n) ____________________ parameter.

reference

You can declare a(n) ____ parameter as a constant by using the keyword const.

reference

The ____________________ of an identifier refers to where in the program an identifier is accessible (visible).

scope

The ____________________ of a function consists of the function name and its formal parameter list.

signature

A variable for which memory remains allocated as long as the program executes is called a(n) ____________________ variable.

static

A function ____________________ is a function that is not fully coded.

stub

A recursive function in which the last statement executed is the recursive call is called a(n) ____ recursive function.

tail

Consider the following code. int fact(int num) { if (num == 0) return 1; else return num * fact(num - 1); } The function fact is an example of a(n) ____________________ recursive function.

tail

(T/F) A do...while loop is a post-test loop.

true

A(n) ____________________ parameter s a formal parameter that receives a copy of the content of the corresponding actual parameter.

value

If a formal parameter is a non-constant reference parameter, its corresponding actual parameter during a function call must be a(n) ____.

variable

Functions that do not have a return type are called ____ functions.

void

If a function needs to return more than one value, as a rule of good programming style, you should change it to a(n) ____________________ function and use the appropriate reference parameters to return the values.

void

The name of a destructor is the character '____', followed by the name of the class.

~

How many destructors can a class have?

1

The statement: return 8, 10; returns the value ____.

10

What is the value of x after the following statements execute? int x = 5; int y = 30; do x = x * 2; while (x < y);

40

The statement: return 2 * 3 + 1, 1 + 5; returns the value ____.

6

In C++, the ____ is an operator called the member access operator. a. . b. , c. :: d. #

A

Which of the following is a repetition structure in C++? a. if b. switch c. while ... do d. do ... while

D

A break statement is legal in a while loop, but not in a for loop.

False

The statement in the body of a while loop acts as a decision maker.

False

(T/F) The public members of a class must be declared before the private members

False.

In ____ structures, the computer repeats particular statements a certain number of times depending on some condition(s).

Looping

What does ADT stand for?

abstract data type

Assume all variables are properly declared. The following for loop executes 20 times. for (i = 0; i <= 20; i++) cout << i;

false


संबंधित स्टडी सेट्स

Exam 4 (Chapter 45) Digestive and GI Treatment Modalities

View Set

Saunders Nclex Fundamentals review

View Set

Unit 3 Detailed Learning Objectives

View Set

Intro to Risk Management and Insurance

View Set

Basic Med Surge Final Exam Review

View Set

347 Ch 21 prep u resp care modalities

View Set

Chapter 38 Medication Administration and Safety for Infants and Children

View Set