Top Posters
Since Sunday
s
5
g
5
K
5
o
5
g
5
o
4
k
4
s
4
I
4
k
4
j
4
o
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 73 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
Good timing, thanks!
wrote...

Yesterday
Smart ... Thanks!
wrote...

2 hours ago
I appreciate what you did here, answered it right Smiling Face with Open Mouth
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  820 People Browsing
Related Images
  
 323
  
 571
  
 83
Your Opinion
What's your favorite coffee beverage?
Votes: 299

Previous poll results: Who's your favorite biologist?