What will happen after the user inputs data into the java - ProProfs Discuss
Topics
Products
Follow Us:

What will happen after the user inputs data into the java program?
score =Keyboard.readInt(); while (score !=  -1) {System.out.println (The score is + score); score =Keyboard.readInt(); }USER INPUT = -1



A. The while statement will continue to ask the user to enter a score and then print out the score that has been received.
B. The while loop will execute an infinite number of times because the program statement can never be false
C. The while statement will never print the statement “The score is” because the condition present within the while will be false on the first time through.
D. The while statement will function until a value other than –1 is entered

This question is part of Computer Programming II Exam (Multiple Choice)
Asked by Justinsmith, Last updated: Mar 18, 2020

+ Answer
Request

1 Answer

John Smith

John Smith

Answered Jan 23, 2017

The while statement will never print the statement “The score is” because the condition present within the while will be false on the first time through.
 

Search for Google images
Select a recommended image
Upload from your computer
Search for Google images
Select a recommended image
Upload from your computer
Search for Google images
Select a recommended image
Upload from your computer

Email Sent
We have sent an email to your address "" with instructions to reset your password.