Convert the following code so that it uses nested while statements instead of for statements:

```
int s = 0;
int t = 1;
for (int i = 0; i < 10; i++)
{
s = s + i;
for (int j = i; j > 0; j--)
{
t = t * (j - i);
}
s = s * t;
System.out.println(“T is “ + t);
}
System.out.println(“S is “ + s);
```


```
int s = 0;
int t = 1;
int i = 0;
while(i<10){
s = s + i;
int j = i;
while(j>0){
t = t * (j - i);
j--;
}
s = s * t;
System.out.println("T is " + t);
i++;
}
System.out.println("S is " + s);
```

This code is in Fragments.java.

Computer Science & Information Technology

You might also like to view...

Match each function-related term with its description

A) Placed between function arguments B) Conditions specified in a logical test C) Placed around text values used as function arguments D) Applies a logical test to see if a specific condition is true E) Compares two values and returns true or false 95) Logical function 96) Comparison operator 97) Criteria 98) Quotation marks 99) Comma

Computer Science & Information Technology

Which two tools would be best to use if a Windows service does not start? (Select two.)

A) Windows XP mode B) Device Manager C) System Configuration D) Task Manager E) Computer Management console

Computer Science & Information Technology

Shapes can be added to a SmartArt.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

A(n) ____________________ is typically a dedicated box that supports any UC provided service.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology