Create a sentinel while loop that prompts the user to enter integer numbers. Loop should stop when the user enters -1.
Added by Vickie G.
Step 1
Initialize a variable to store the user input. Show more…
Show all steps
Your feedback will help us improve your experience
Sophia Furfine and 57 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Write a program to enter the numbers till the user wants and at the end the program should display the largest and smallest numbers entered. loop should terminate when user enter -999.
Vandit T.
Design a program with a loop that asks the user to enter a series of positive numbers. The user should enter a negative number to signal the end of the series. After all the positive numbers have been entered, the program should display the sum of all EVEN numbers.
Shelayah R.
EvensOnly.java (while Loop) - A program that allows the user to enter a series of numbers and computes the total value. The loop will stop when an odd number is entered. The program will display the total after the loop terminates. Only integers will be entered, and only even numbers will be added to the total.
Sarvesh S.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Watch the video solution with this free unlock.
EMAIL
PASSWORD