subject

What is the sentinel value in the following code snippet?
public static void main(String[] args)
{
int age = 0;
int sum_of_ages = 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)
{
sum_of_ages = sum_of_ages + age;
System. out. println("Enter an age (-1 to stop): ");
age = reader. nextInt();
}
System. out. println("Sum of ages " + sum_of_ages);
return 0;
}

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 11:30, stodd9503
Awell-diversified portfolio needs about 20-25 stocks from different categories is this true or false?
Answers: 2
image
Computers and Technology, 23.06.2019 09:20, lovely222
How to print: number is equal to: 1 and it is odd number number is equal to: 2 and it is even number number is equal to: 3 and it is odd number number is equal to: 4 and it is even number in the console using java using 1 if statement, 1 while loop, 1 else loop also using % to check odds and evens
Answers: 3
image
Computers and Technology, 23.06.2019 20:00, shadow6728g
How much current flows through the alternator brushes? a. 2–5 a b. 25–35 a, depending on the vehicle c. 5–10 a d. 10–15 a
Answers: 2
image
Computers and Technology, 24.06.2019 01:30, shonnybenskin8
Hazel has just finished adding pictures to her holiday newsletter. she decides to crop an image. what is cropping an image?
Answers: 1
You know the right answer?
What is the sentinel value in the following code snippet?
public static void main(String[] arg...

Questions in other subjects:

Konu
Physics, 10.12.2020 21:10
Konu
Chemistry, 10.12.2020 21:10