Are you taking CLEP classes? Try clep.ai
| preferred AP College board partner for AP classes
AP Computer Science A/Unit 1: Primitive Types
Start Practice TestPractice Test
About Exam
medium Solved by 9 students

Integer Division and Type Casting

Mark
< Prev
Next >

The integer variables sum and count store the sum of all scores and the number of games played, respectively. Both variables have been initialized with positive values. Which of the following statements correctly calculates the average score and assigns the result to a double variable named average?

A

double average = sum / count;

B

double average = double (sum / count);

C

double average = (double) (sum / count);

D

double average = (double) sum / count;

Hint
Did You Know?
Explain Why
Explain All Answers
Check Answer
Show Correct Answer
Report Question

Question Leaderboard

Rank
User
Correct Count
Attempt Count
Total Time
Score
#1Wilbert.Ankomah2711 0m 17s 83
#2shelter200200411 0m 32s 68
#3parth.taur22711 0m 43s 57
#4y.seong202712 0m 46s 44
#5patrickmeijer00912 0m 46s 44
#6Potter1601 0m 14s -24
#7jaimonjosh01 0m 46s -56
#8thamminenigamya11 3m 45s -125
#9lsj0803092211 4m 06s -146
#10bommasam00012 5m 02s -212
Items per page:
10
1 – 10 of 10

AI Tutor

How can I help?

APFIVE © 2020.
Email: apfive@apfive.org|Privacy Policy|