Examlex

Solved

Suppose Sum and Num Are Int Variables, and the Input

question 29

Multiple Choice

Suppose sum and num are int variables, and the input is 20 25 10 18 -1 What is the output of the following code? (Assume that console is a Scanner object initialized to the standard input device.) sum = 0; num = console.nextInt() ; while (num != -1) {if (num >= 20) sum = sum + num; else sum = sum - num; num = console.nextInt() ;} System.out.println(sum) ;


Definitions:

Electric Charge

A physical property of matter that causes it to experience a force when placed in an electromagnetic field.

Nucleus

The central and most important part of an atom, or a cell's organelle that contains genetic material.

Abundant Elements

Chemical elements that occur in large quantities in the Earth's atmosphere, crust, or oceans, or in the universe at large.

Human Body

The entire structure of a human being encompassing physical, biological, and chemical processes that work together to maintain life.

Related Questions