AP Computer Science A Quiz
16 questions · no time limit
0:00
USING OBJECTS AND METHODS
Question 1 of 16
No time limit
Current
Answered
Flagged
Not seen
An e-commerce app totals prices as floats:
class Cart {
public static int checkoutCents(float priceA, float priceB) {
float total = priceA + priceB;
int cents = (int) (total * 100); // rounding/truncation risk
return cents;
}
}How can the casting from float to int affect the calculation? YOUR PROGRESS
16
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