Given the following code: int deduction = 0; Scanner scan = new Scanner (System.
ID: 3826040 • Letter: G
Question
Given the following code: int deduction = 0; Scanner scan = new Scanner (System. in); System. out. println ("Enter a negative nonzero number"); deduction scan next lnt(); Write this statement {System. out. println ("The number you entered is invalid. "); System. out. println("Enter a negative nonzero number"); deduction = scan nextInt();}//End While Assume that valid input data must be a negative nonzero number. Type the exact text for the line of Java that should replace Write this statement shown above.Explanation / Answer
Please find my answer.
while(deduction >= 0){
System.out.println("The number you entered is invalid");
System.out.println("Enter a negative nonzero number");
deduction = scan.nextInt();
}
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.