1 ____ is an example of a syntax error. Choose one answer.

a. cout

b. cin >> raiseRate;

c. cout

d. average = number1 + number2 / 2; ..

Question 2 You can use the multiplication assignment operator to abbreviate the statement price = price * 1.05; as follows: ____.Choose one answer.

a. price =* 1.05;

b. price *= 1.05;

c. price = * 1.05;

d. price * = 1.05; ..

Question 3 The selection structure is one of the ____ basic control structures you can use in a program. Choose one answer.

a. three

b. five

c. two

d. four .

. Question 4 Using ____ as a comparison operator is a syntax error. Choose one answer.

a. =>

b.

c. ==

d. != ..

Question 5 Logical operators are sometimes referred to as ____ operators. Choose one answer.

a. Relational

b. Conditional

c. Comparison

d. Boolean ..

Question 6 When the ____ logical operator is used, only one of the conditions must be true for the compound condition to be true. Choose one answer.

a. Nor

b. Or

c. Not

d. And . .

Question 7 To display real numbers in fixed-point notation, you use the ____ stream manipulator. Choose one answer.

a. fixed

b. decimal

c. setprecision

d. scientific ..

Question 8 For a program to use the setprecision stream manipulator, it must contain the ____ directive. Comments: The “<>” have been removed from the text after the #include statement so that the answer could be displayed. This is not a trick question. Just assume that whatever is after the “#include” statement is within those marks: #include #include #include #include Choose one answer.

a. #include std

b. #include string

c. #include iomanip

d. #include iostream ..

Question 9 Consider the following pseudocode: 1. enter the code and sales amount 2. calculate the bonus amount by multiplying the sales amount by.08 3. if (the code is X) if (the sales aregreater than or equal to 10000) add150 to the bonus amount else add 125to the bonus amount end if end if 4. display the bonus amount If the code is X and the sales amount is 15000, the value of the bonus amount at the end of the algorithm in theaccompanying figure will be ____. Choose one answer.

a. 1200

b. 845

c. 1350

d. 720 ..

Question 10 The flowchart symbol for the selection structure is the ____. Choose one answer.

a. rectangle

b. diamond

c. parallelogram

d. oval ..

Question 11 Instead of using the multiple-alternative form of the if statement, you may sometimes use the ____ statement to code a multiple-alternative selection structure in C++. Choose one answer.

a. switch

b. else

c. otherwise

d. nested ..

Question 12 You can code a pretest loop in C++ using the ____ statement. Choose one answer.

a. loop

b. repeat

c. while

d. switch ..

Question 13 loop that processes its instructions indefinitely is referred to as a ____ loop. Choose one answer.

a. non-sentinel

b. accumulating

c. infinite

d. incorrect ..

Question 14 A ____ is a numeric variable used for counting something, such as the number of employees paid in a week Choose one answer.

a. iterator

b. sentinel

c. counter

d. accumulator ..

Question 15 Updating, also called ____, means adding a number to the value stored in the counter or the accumulator. Choose one answer.

a. iterating

b. flushing

c. accumulating

d. incrementing ..

Question 16 A repetition structure can be either a pretest loop or a ____ loop. Choose one answer.

a. endless

b. outer

c. inner

d. posttest ..

Question 17 The instructions in a ____ loop will always be processed at least once. Choose one answer.

a. inner

b. while

c. posttest

d. pretest ..

Question 18 The evaluation of the condition in a ____ loop occurs before the instructions within the loop are processed. Choose one answer.

a. inner

b. do while

c. pretest

d. posttest ..

Question 19 In a flowchart, the stop ____ marks the end of the flowchart. Choose one answer.

a. parallelogram

b. rectangle

c. diamond

d. oval ..

Question 20 int sales = 0; int region = 1; int totRegSales = 0; while (region < 3) { cout << “Firstsales amount for Region ” << region<< “: “; cin >> sales; while (sales > 0) { totRegSales =totRegSales + sales; cout <<“Next sales amount for Region ” << region << “: “; cin >> sales; } //end while cout

a. a number greater or equal than 3

b. either the number 0 or a negative number

c. a negative number

d. the number 0 ..

Question 21 The statement ____ tells the computer to get the current weekly pay from the keyboard, and store that amount in the currentPay variable. Choose one answer.

a. currentPay >> cin;

b. cin >> currentPay;

c. currentPay

d. cin

Question 22 Most ____ occur as a result of mistyping either a keyword or avariable name, or forgetting to enter a semicolon at the end of a statement. Choose one answer.

a. syntax errors

b. bugs

c. logic errors

d. warnings ..

Question 23 5 – 2 > 1 + 2 evaluates to ____. Choose one answer.

a. 6

b. false

c. true

d. 3 ..

Question 24 The And operator in C++ is ____. Choose one answer.

a. ||

b. !

c. &

d. && ..

Question 25 What is the problem with the following algorithm? 1. enter the code and sales amount 2. calculate the bonus amount by multiplying the sales amount by.08 3. if (the code is X) if (the sales aregreater than or equal to 10000) add 150 to the bonus amount else if(the sales are less than 10000) add 125 to the bonus amount endif end if end if 4. display the bonus amount Choose one answer.

a. The primary and secondary decisions are reversed.

b. It includes an unnecessary nested selection structure.

c. It uses a logical operator when a nested selection structure should be used.

d. There is no problem with the algorithm.



Source link

Leave a Reply

Your email address will not be published.