Using a for Loop NewMultiply.java 16 int byTen; // Stores the number multiplied by 10. Instructions 17 int byTwo; // Stores the number multiplied by 2. 1. Write a for loop that uses 18 final int NUM_LOOPS = 10; // Constant the loop control variable to used to control loop. 19 take on the values 0 through // This is the work done in the housekeeping () method 20 10. System.out.println("0 through 10 multiplied by 2 and by 10" + "\n"); 21 2. In the body of the loop, multiply the value of the loop 22 | 23 detailloop() method // Write for loop control variable by 2 and by // This is the work done in the 10. 24 3. Execute the program. Is the 25 // This is the work done in the endof Job() method 26 output the same? System.exit(0); } // End of main() method. 27 Grading 28 29 When you have completed your 30 } // End of NewMultiply class. 31 program, click the Submit button

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

i need help with the step 2 section.

Using a for Loop
NewMultiply.java
>_ Terminal
1 // NewMultiply.java - This program prints
the numbers ® through 10 along
Summary
2 // with these values multiplied by 2 and by
10.
In this lab the completed program
3 // Input: None.
4 |/ Output: Prints the numbers 0 through 10
should print the numbers 0
through 10, along with their values
along with their values multiplied by 2 and
multiplied by 2 and by 10. You
by 10.
5
should accomplish this using a
for loop instead of a counter-
7 public class NewMultiply
8 {
public static void main(String args[])
{
controlled while loop.
9
10
Instructions
11
12
String head1 = "Number: ";
1. Write a for loop that uses
13
String head2 = "Multiplied by 2: ";
the loop control variable to
14
String head3 = "Multiplied by 10:
";
take on the values O through
15
int numberCounter;
// Numbers 0
10.
through 10.
2. In the body of the loop,
16
int byTen;
// Stores the number
multiplied by 10.
int byTwo;
multiply the value of the loop
// Stores the
17
Transcribed Image Text:Using a for Loop NewMultiply.java >_ Terminal 1 // NewMultiply.java - This program prints the numbers ® through 10 along Summary 2 // with these values multiplied by 2 and by 10. In this lab the completed program 3 // Input: None. 4 |/ Output: Prints the numbers 0 through 10 should print the numbers 0 through 10, along with their values along with their values multiplied by 2 and multiplied by 2 and by 10. You by 10. 5 should accomplish this using a for loop instead of a counter- 7 public class NewMultiply 8 { public static void main(String args[]) { controlled while loop. 9 10 Instructions 11 12 String head1 = "Number: "; 1. Write a for loop that uses 13 String head2 = "Multiplied by 2: "; the loop control variable to 14 String head3 = "Multiplied by 10: "; take on the values O through 15 int numberCounter; // Numbers 0 10. through 10. 2. In the body of the loop, 16 int byTen; // Stores the number multiplied by 10. int byTwo; multiply the value of the loop // Stores the 17
+
Using a for Loop
NewMultiply.java
>- Terminal
16
int byTen;
// Stores the number
multiplied by 10.
int byTwo;
Instructions
17
// Stores the
number multiplied by 2.
1. Write a for loop that uses
18
final int NUM_LOOPS = 10; // Constant
the loop control variable to
used to control loop.
19
take on the values O through
20
// This is the work done in the
10.
housekeeping () method
System.out.println("0 through 10
multiplied by 2 and by 10" + "\n");
21
2. In the body of the loop,
multiply the value of the loop
22
control variable by 2 and by
23
// This is the work done in the
detailloop() method
24
10.
// Write for loop
3. Execute the program. Is the
25
// This is the work done in the
endof Job() method
26
output the same?
System.exit(0);
} // End of main() method.
27
Grading
28
29
When you have completed your
30 } // End of NewMultiply class.
31
program, click the Submit button
32
to record your score.
Transcribed Image Text:+ Using a for Loop NewMultiply.java >- Terminal 16 int byTen; // Stores the number multiplied by 10. int byTwo; Instructions 17 // Stores the number multiplied by 2. 1. Write a for loop that uses 18 final int NUM_LOOPS = 10; // Constant the loop control variable to used to control loop. 19 take on the values O through 20 // This is the work done in the 10. housekeeping () method System.out.println("0 through 10 multiplied by 2 and by 10" + "\n"); 21 2. In the body of the loop, multiply the value of the loop 22 control variable by 2 and by 23 // This is the work done in the detailloop() method 24 10. // Write for loop 3. Execute the program. Is the 25 // This is the work done in the endof Job() method 26 output the same? System.exit(0); } // End of main() method. 27 Grading 28 29 When you have completed your 30 } // End of NewMultiply class. 31 program, click the Submit button 32 to record your score.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY