| 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 13 students
Integer Division and Type Casting
< 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
Time
Score
#1shelter200200411 0m 32s 68
#2parth.taur22711 0m 43s 57
#3y.seong202712 0m 46s 44
#4patrickmeijer00912 0m 46s 44
#5jaimonjosh01 0m 46s -56
#6thamminenigamya11 3m 45s -125
#7lsj0803092211 4m 06s -146
#8bommasam00012 5m 02s -212
Items per page:
10
1 – 8 of 8

AI Tutor

How can I help?

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