Examlex

Solved

What Is the Sentinel Value in the Following Code Snippet

question 57

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:

Exchange Rate Gain

A profit resulting from a favorable change in the exchange rate between two currencies.

British Pound

The currency of the United Kingdom, symbolized as GBP, and one of the world's major currencies traded on foreign exchange markets.

Direct Quotes

A method of quoting exchange rates in foreign exchange markets where the domestic currency is the base and the foreign currency is the quoted currency.

Canadian Dollar

The official currency of Canada, represented by the symbol CAD or C$, often used in international finance and trade.

Related Questions