Question: write a while loop that prompts a user for positive integers ( assume a Scanner s already exists ) . If the number is a

write a while loop that prompts a user for positive integers (assume a Scanner s already exists). If the number is a 5,7, or 11, print out Thats my lucky number!. Keep prompting the user to enter numbers until the user enters a negative number. Make sure to use a break statement in your code. You may assume that java.util.Scanner has already been imported.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!