Examlex

Solved

Write a Code Fragment That Allows a User to Continue

question 27

Essay

Write a code fragment that allows a user to continue inputting numbers until she enters a sentinel value of 0. Then print the sum of all the numbers she entered. You may assume that a Scanner object called input has already been created.


Definitions:

Word

In computing, a fixed-sized piece of data handled as a unit by the instruction set or the hardware of the processor.

Register

A small, fast storage location within a computer's CPU used to hold data and instructions that are currently being processed.

File

A collection of data stored in one unit, identified by a filename; can represent documents, programs, or other collections of information.

Value

A numerical quantity that is assigned or is determined by calculation or measurement.

Related Questions