Exam Solved

25.00 $ 12.50 $

Category:
Click Category Button to View Your Next Assignment | Homework

You'll get a download link with a: . pdf solution files instantly, after Payment

Description

5/5 - (2 votes)

(TCO 2) When a program evaluates mathematical expressions, which of the following operators (or mathematical operations) has the highest precedence?

(Points : 5)

Subtraction

Addition

Parentheses

All have equal precedence.

 

(TCOs 2, 7) Which one of the following is not a valid assignment statement in a program?

(Points : 5)

b = -b

x – 6 = a

a = a + 1

None of the above

 

(TCO 2) Which value will be contained in the variable x after the following statement is executed?

x = 20 – 10 * 2 / (5 – 1)

(Points : 5)

0

10

5

15

 

If you use a loop to sum up a number of test scores, you will need a variable to act as a(n) _____.

(Points : 5)

flag

symbol

counter

accumulator

(TCO 4) For maximum efficiency, which question should be asked first when working with an Or decision?

(Points : 5)

The one less likely to be true

The one most likely to be true

The one that involves fewer comparisons

There is not enough information to determine the answer.

 

(TCOs 3, 4, and 8) In the following pseudocode, which raise will an employee in Department 6 receive?

 

If department < 2 then

Set raise = 1000

Else

If department < 6 then

Set raise = 2500

Else

Set raise = 3000

EndIf

EndIf

(Points : 5)

1,000

2,500

3,000

0

 

(TCOs 3 and 4) Which of the selection structures determine whether the user enters a number within a range of 5 and 15?

 

(Points : 5)

If commission <> 15

If commission <= 15

If (commission < 5) || (commission >15)

If (commission >=5) && (commission <= 15)

 

 

Question 4.4. (TCOs 3, 4, and 8) Which value gets displayed for the variable Z?

 

Set balance = 800

Set stateCode = 8

Set creditCode = 9

If (balance <> 800) AND (stateCode <> 6) AND (creditCode <> 7) then

Set Z = 3

Else

Set Z = 2

EndIf

Display Z

(Points : 5)

6

2

3

7

 

 

 

 

Question 5.5. (TCO 5) Whether or not the loop body is executed is controlled by a(n) _____.

(Points : 5)

Boolean expression

arithmetic expression

loop iteration

assignment statement

 

 

Question 6.6. (TCO 5) Which loop must execute the body of the loop at least once?

(Points : 5)

A pretest loop

A post-test loop

A sequence structure

A selection structure

 

 

Question 7.7. (TCO 5) In the following code, how many times will the loop body be executed?

 

int num;

for (num = 10; num <= 20;num+=5)

{

Console.WriteLine(num);

}

 

(Points : 5)

0

3

4

6

 

 

 

 

Question 8.8. (TCOs 3, 5, and 8) In the following code, how many times will the loop body be executed?

 

int x=6;

while(x<=6)

{

Console.WriteLine(x);

x = x + 1;

}

(Points : 5)

0

1

6

7

 

 

 

 

Question 9.9. (TCO 6) Which is an array element?

(Points : 5)

A specific value in an array

An alternate name for an array

A number that indicates the position of a particular item within an array

A number that represents the highest value stored within an array

 

 

 

Question 10.10. (TCO 6) Which is the value of the index used to access the first element in a C# array declared as the following?

int[] num = new int[20];

(Points : 5)

20

9

1

0

 

 

 

 

Question 11.11. (TCOs 5 and 6) Which control structure can be used to process every element of an array?

 

(Points : 5)

Selection control structure

While loop

For loop

B or C

 

 

Question 12.12. (TCO 6) A zero-based array named sales has been declared and loaded with the values 100, 1100, 3400, 5550, 3000, 22300, and 1200. Which value(s) will be stored in the array element sales[0]?

(Points : 5)

100

1100

3400

100, 1100

 

 

Question 13.13. (TCOs 7 and 8) Which type of error occurs when an array subscript’s value goes beyond the total number of elements in the array?

(Points : 5)

Syntax error

Runtime error

Logic error

Out-of-bounds error

 

 

Question 14.14. (TCOs 3 and 8) Which of the following is not an advantage of modular design?

(Points : 5)

It increases complexity.

Modules can be reused.

It is easier to work in teams — different people completing different modules.

All of the above are advantages.