Question: For the Decision Table questions below, use the following function: int discountPercent ( double price, int pastOrderCount ) returns the percent discount to be given,

For the Decision Table 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
<
1
0
|
0
%
1
0
<
=
pastOrderCount
<
=
4
0
|
5
%
4
0
<
pastOrderCount
|
1
0
%
Orders over $
1
0
0
0
.
0
0
are given an automatic, additional
1
%
discount.
Path Testing
For the Path Testing questions below, use the following code:
public void play
(
)
{
String src
=
null;
String dest
=
null;
LinkedList srcPile
=
null;
boolean gameOver
=
false;
while
(
!
gameOver
)
{
displayTableau
(
)
;
do
{
System.out.print
(
"
Move top card from
(
D
,
W
0
,
W
1
,
W
2
,
W
3
,
or Q to quit
)
:
"
)
;
src
=
in
.
nextLine
(
)
;
if
(
src
.
toUpperCase
(
)
.
charAt
(
0
)
=
=
'
Q
'
)
{
gameOver
=
true;
}
}
while
(
!
gameOver &&
(
srcPile
=
getSrcPile
(
src
)
)
=
=
null
)
;
if
(
!
gameOver
)
{
System.out.print
(
"
to
(
F
0
,
F
1
,
F
2
,
F
3
,
W
0
,
W
1
,
W
2
,
W
3
)
:
"
)
;
dest
=
in
.
nextLine
(
)
;
addToDestPile
(
dest
,
srcPile
)
;
}
gameOver
=
checkForGameOver
(
gameOver
)
;
}
}
Rule Counts
1) What is the maximum number of rules for this function (if we do not collapse any.)
2) Show your Decision Table from the Base Assignment
-Annotate the columns with the number of rules each covers.
DD-Path Node Case Definitions
1)For the DD-Path Graph create and add the Case Definition (1-5) to your table for each node in that DD-Path Graph.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!