Write a program using nested for loops that will print the table below exactly as shown:   10        11        12        13        14        15        16        17        18        19 20        21        22        23        24        25        26        27        28        29 30        31        32        33        34        35        36        37        38        39 40        41        42        43        44        45        46        47        48        49   You MUST use nested for loops to accomplish this.  You MUST store the value printed in a variable.  You cannot just print the values as a String like “10   11    12   13   14 ….”

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section5.5: A Closer Look: Loop Programming Techniques
Problem 14E
icon
Related questions
Question
100%

Write a program using nested for loops that will print the table below exactly as shown:

 

10        11        12        13        14        15        16        17        18        19

20        21        22        23        24        25        26        27        28        29

30        31        32        33        34        35        36        37        38        39

40        41        42        43        44        45        46        47        48        49

 

You MUST use nested for loops to accomplish this.  You MUST store the value printed in a variable.  You cannot just print the values as a String like “10   11    12   13   14 ….”

Questions

 

  1. What is the primary difference between how a while loop operates and how a do while loop operates?

 

 

 

 

 

 

 

  1. View the code below and indicate where each variable would have scope. (Circle all boxes for each variable in which that variable would be useable.

 

class DoLittle {
   public static void main(String[] args) {
      int number = 3;

 double cost = 11.00;
      while(number >= 0) {
         int value = 7;

    if(value > 5){
         value = value + 2;
         number = number - 1;

    String message = “good job!”;

    }

 }
      value = 9;

 System.out.println(cost);
   }
}

 

 

Variables                  In which blocks is each useable?

 

number                      main method             while loop                  if block

 

cost                             main method             while loop                  if block

 

value                          main method             while loop                  if block

 

message                    main method             while loop                  if block

 

in java

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Random Class and its operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr