Top Posters
Since Sunday
A
6
j
6
c
5
m
5
C
5
d
5
s
5
n
4
i
4
d
4
d
4
J
4
New Topic  
mdagenh1 mdagenh1
wrote...
Posts: 439
Rep: 1 0
4 years ago
Analyze the following code.

double sum = 0;
for (double d = 0; d < 10; sum += sum + d) {
d += 0.1;
}


▸ The program has a syntax error because the control variable in the for loop cannot be of the double type.

▸ The program compiles but does not stop because d would always be less than 10.

▸ The program compiles and runs fine.

▸ The program has a syntax error because the adjustment statement is incorrect in the for loop.
Textbook 
Introduction to Java Programming, Comprehensive Version

Introduction to Java Programming, Comprehensive Version


Edition: 10th
Author:
Read 75 times
1 Reply
Replies
Answer verified by a subject expert
purplepanda1516purplepanda1516
wrote...
Posts: 415
4 years ago
Sign in or Sign up in seconds to unlock everything for free
More solutions for this book are available here

Related Topics

mdagenh1 Author
wrote...

4 years ago
Brilliant
wrote...

Yesterday
This calls for a celebration Person Raising Both Hands in Celebration
wrote...

2 hours ago
Good timing, thanks!
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  1069 People Browsing
Related Images
  
 326
  
 1803
  
 28
Your Opinion
Which of the following is the best resource to supplement your studies:
Votes: 292