What does the following program print?

```
// Mystery.java
public class Mystery {
public static void main(String[] args) {
int x = 1;
int total = 0;

while (x <= 10) {
int y = x * x;
System.out.println(y);
total += y;
++x;
}

System.out.printf("Total is %d%n", total);
}
}

```


1
4
9
16
25
36
49
64
81
100
Total is 385

Computer Science & Information Technology

You might also like to view...

At the heart of a computer is its central processing unit. The CPU's job is:

a. To fetch instructions b. To carry out the operations commanded by the instructions c. To produce some outcome or resultant information d. All of these e. None of these

Computer Science & Information Technology

As shown in the accompanying figure, Visual Basic 2010 contains a(n) ____ Tag that allows you to create a full standard menu bar commonly provided in Windows programs.

A. Menu B. Action C. Legend D. Glossary

Computer Science & Information Technology

Help desk customers can be internal employees and external paying customers

a. Internal employees b. External paying customers c. Both a. and b. d. None of the above

Computer Science & Information Technology

What principle might tell the developer to create one server that creates security keys and another server that stores the keys?

A. Least privilege B. Secrets are hard to keep C. Fail securely D. Separation of privilege

Computer Science & Information Technology