int i = 5; if(++i == 5) i = 2 * i; if(i > 5) i = i + 1; if(i % 2 == 0) i = i + 1; else i = i + 2; switch(i){ case 10: i = 0; break; case 11: i = i - 2; break; case 12: i = 2 * i; break; case 13: i = 5; break; default: i = 10; }
Added by Irene V.
Step 1
i is initially set to 5. Show more…
Show all steps
Your feedback will help us improve your experience
Jennifer Stoner and 69 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Given the switch statement, which of the following would be the first if statement to replace the first test in the switch? a. if (case = 11 ) b. if (case = $=11$ ) c. if $(\text { control }==11)$ d. if ( switch = $=11$ ) e. none of the above
What value is stored in result if int result $=13-3 * 6 / 4 \% 3$ (A) -5 (B) 0 (C) 13 (D) -1 (E) 12
If $\mathbf{F}_{1}=-20 \hat{\mathbf{y}}, \mathbf{F}_{2}=-10 \hat{\mathbf{i}},$ and $\mathbf{F}_{3}=5 \hat{\mathbf{i}}+10 \hat{\mathbf{j}},$ what is the sum $\mathbf{F}_{1}+\mathbf{F}_{2}+\mathbf{F}_{3}$ (A) $-15 \hat{\mathbf{i}}+10 \hat{\mathbf{j}}$ (B) $-5 \hat{\mathbf{i}}-10 \hat{\mathbf{j}}$ (C) 5$\hat{\mathbf{i}}$ (D) $5 \hat{\mathbf{i}}-10 \hat{\mathbf{j}}$
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD