Free Practice Quiz Question List

2 Algorithms and Solution Design Online Quiz Questions

Use this free practice quiz with 20 questions to review 2 Algorithms and Solution Design, test your knowledge, and prepare for your next test or exam.

20 questions
01
True or false
1 point

True or false: An algorithm must eventually stop after a finite sequence of steps.

  1. A

    True

  2. B

    False

02
Choose one
1 point

Which flowchart symbol should represent the question “Is purchaseAmount at least 100?”

  1. A

    A rectangle

  2. B

    A diamond

  3. C

    A parallelogram

  4. D

    An oval or rounded rectangle

03
Written response
1 point

What computational-thinking technique divides a complex task into smaller subproblems?

04
Fill in the blank
1 point

Complete the specification: The information supplied to an algorithm is its , and the result it produces is its .

05
Choose one
1 point

An algorithm repeatedly displays the values 1 through 5 by executing a loop. Which basic control structure is being used?

  1. A

    Iteration

  2. B

    Selection

  3. C

    Sequence

  4. D

    Validation

06
True or false
1 point

True or false: In the discount algorithm, the loop that rejects negative purchase amounts is an example of input validation rather than normal result processing.

  1. A

    True

  2. B

    False

07
Choose all
1 point

Which test inputs would directly test the discount threshold or the nonnegative-input validation rule? Select all correct choices.

  1. A

    99.99

  2. B

    100

  3. C

    -5

  4. D

    80

08
Written response
1 point

Using the stated discount rule, what final price results from a purchase amount of 150 dollars? Enter the value in dollars.

09
Fill in the blank
1 point

Complete the pseudocode keyword: purchaseAmount >= 100 THEN begins the conditional that chooses whether to apply the discount.

10
Choose one
1 point

A dry run uses purchaseAmount = 120. What output format is required after applying the discount and rounding the monetary result as specified?

  1. A

    $108

  2. B

    $108.0

  3. C

    $108.00

  4. D

    $108.000

11
Choose all
1 point

Which properties are explicitly expected of a well-designed algorithm? Select all correct choices.

  1. A

    Correct for every valid input

  2. B

    Unambiguous

  3. C

    Visually colorful

  4. D

    Testable

12
Open ended
1 point

Design a language-independent algorithm for the store discount problem. It must accept a nonnegative purchase amount, apply a 10% discount only when the amount is at least 100, reject negative input through re-entry, and display the final price rounded to two decimal places. Describe the steps in pseudocode or precise ordered prose.

13
Choose one
1 point

Which statement best describes an assumption in an algorithmic problem specification?

  1. A

    A result produced after the algorithm finishes

  2. B

    An accepted condition that the problem does not otherwise specify

  3. C

    A symbol used only for output in a flowchart

  4. D

    A test value chosen only because it is invalid

14
True or false
1 point

True or false: In a flowchart, a diamond represents a decision or condition.

  1. A

    True

  2. B

    False

15
Written response
1 point

Which basic control structure should you use when an algorithm must repeat a group of instructions while or until a condition is satisfied?

16
Choose one
1 point

A program must reject negative purchase amounts and ask for another value before calculating a price. Which step is input validation?

  1. A

    Calculate the final price for a valid purchase amount.

  2. B

    Check whether the purchase amount satisfies the nonnegative constraint.

  3. C

    Apply the discount to every purchase amount.

  4. D

    Round the final price to two decimal places.

17
Written response
1 point

Using the discount rule described in the material, what is the final price for a valid purchase amount of 150 dollars? Enter the numeric value to the nearest cent.

18
Choose one
1 point

An algorithm gives a discount when a purchase amount is at least 100. Which test set most directly checks the boundary and the behavior on both sides of it?

  1. A

    80, 150, and 200

  2. B

    0, 50, and 75

  3. C

    99.99, 100, and 100.01

  4. D

    -5, -1, and 0

19
Choose one
1 point

A flowchart must show the step that displays the calculated final price. Which symbol should represent that input or output action?

  1. A

    Parallelogram

  2. B

    Rectangle

  3. C

    Diamond

  4. D

    Oval or rounded rectangle

20
Choose one
1 point

Which specification best describes a general solution for the store discount problem?

  1. A

    Apply the discount only to purchase amounts greater than 100.

  2. B

    Calculate a result only when the purchase amount is exactly 100.

  3. C

    Reject every purchase amount below 100 as invalid.

  4. D

    For every nonnegative amount, apply the discount at or above 100 and otherwise leave the amount unchanged.