AP Computer Science A Quiz
12 questions · no time limit
0:00
SELECTION AND ITERATION
Question 1 of 12
No time limit
Current
Answered
Flagged
Not seen
In an online cart, this code applies discounts. What is discount when isMember=true and purchaseAmount=120?
boolean isMember = true;
double purchaseAmount = 120.0;
double discount = 0.0;
// Member gets bigger discount
if (isMember) {
// Larger discount for $100+
if (purchaseAmount >= 100.0) discount = 0.15;
else discount = 0.10;
} YOUR PROGRESS
12
QUESTIONS
Ready when you are
Answer in any order. Your progress shows here as you go.
QUESTIONS
KEYBOARD
Pick an answer ABCD
Next question ↵→
Previous ←
Flag for review F
Answers save as you go · flagged questions come back at the end