Are you taking CLEP classes? Try clep.ai
| preferred AP College board partner for AP classes
easy Solved by 11 students

For Loop Accumulator Variable

< Prev
Next >

Consider the following code segment. What value is printed when the code is executed?

public class Savings {
    public static void main(String[] args) {
        int total = 0;
        for(int day = 1; day <= 7; day++) {
            total += day * 2;
        }
        System.out.println(total);
    }
}
A

28

B

49

C

54

D

56

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

Question Leaderboard

Rank
User
Correct Count
Attempt Count
Total Time
Score
#1hadleysmith522 0m 00s 200
#2hitrishabhatia11 0m 00s 100
#3sgarv251311 0m 00s 100
#4mertdeg14 0m 00s 70
#5y.seong202711 0m 44s 56
#6midnightasdark12 1m 43s -13
#7yuvansankarnyc11 2m 01s -21
#8gtsak3111 2m 50s -70
#9suhanakochhar00611 9m 19s -459
#10Pelisx11 25m 55s -1,455
Items per page:
10
1 – 10 of 10
No comments yet. Be the first to comment!

AI Tutor

How can I help?

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