Examlex

Solved

What Is the Sentinel Value in the Following Code Snippet

question 55

Multiple Choice

What is the sentinel value in the following code snippet?
Public static void main(String[] args)
{
Int age = 0;
Int sumOfAges = 0;
Int stop = 1;
Scanner reader = new Scanner(System.in) ;
System.out.println("Enter an age (-1 to stop) : ") ;
Age = reader.nextInt() ;
While (age != -1)
{
SumOfAges = sumOfAges + age;
System.out.println("Enter an age (-1 to stop) : ") ;
Age = reader.nextInt() ;
}
System.out.println("Sum of ages " + sumOfAges) ;
Return 0;
}


Definitions:

JavaScript

An Internet protocol (IP) addressing scheme that makes IP addresses longer, thereby providing more available addresses.

DOM

Document Object Model; a programming interface for web documents, representing the page so that programs can change the document structure, style, and content.

Italicized

Text that is slanted to the right, often used for emphasis or to distinguish titles of works from the rest of the text.

United States Government

The federal government of the United States, comprising the legislative, executive, and judicial branches, responsible for governing the country.

Related Questions