The Percent Discount To Be Given, When Given The Price Of The Merchandise, And The Number Of Orders The Customer Has Placed In The Past.

computer science

Description

Function

For the questions below, use the following function:

int discountPercent(double price, int pastOrderCount)

returns the percent discount to be given, when given the price of the merchandise, and the number of orders the customer has placed in the past.

Past Order Count

Percent Discount

pastOrderCount < 10

0%

10 ≤ pastOrderCount ≤ 40

5%

40 < pastOrderCount

10%

Orders over $1000.00 are given an automatic, additional 1% discount.

Ranges

  1. List the valid range of values for each of the two variables. Give the minimum and maximum, and whether each extreme is a "physical" limit or an arbitrary limit. If it's an arbitrary limit, why did you choose that limit?
    1. price
    2. pastOrderCount

Normal Boundary Values

  1. List the 5 normal boundary values for each of the two variables.
    1. price
    2. pastOrderCount

Unique Test Cases

  1. Give the set of unique test cases for the normal boundary values in set notation.
  2. Give the test cases in a table format including the expected output for each case.

Robust Boundary Values

  1. List the additional robust boundary values.
  2. List the additional test cases for the robust boundary values in table format.

Equivalence Classes

  1. What are the equivalence class boundaries in each of the two variables?
    1. price
    2. pastOrderCount
  2. List the intervals within the boundaries in interval notation.
  3. List the equivalence classes for valid values in set notation.
  4. List the equivalence classes for invalid values in set notation.

Weak Normal Equivalence Class Test Cases

  1. List test cases for Weak Normal Equivalence Classes in table format. Number them.
  2. Do you see any gaps or problems? If so, what are they?

Strong Normal Equivalence Class Test Cases

  1. List additional test cases for Strong Normal Equivalence Classes in table format. Number them.
  2. Do you see any gaps or problems? If so, what are they?


Related Questions in computer science category