Intro to Java Day 11 Homework
Email *
What is a sentinel value? *
1 point
Which of the following are correct headers for a while loop? Assume x is an integer variable. *
1 point
How many times will this code run?

int count = 1;
while (count <= 5){
    System.out.println (count);
    count++;
}
*
1 point
Please find the EXACT outputs of these code segments without putting the code in your IDE. Go to the next line when necessary and if there is an infinite loop, say so.
Part a  *
1 point
Part b *
1 point
Part c *
1 point
Programming question

Create a login program that checks username and password. The user can have as many attempts as they want. If the user got the correct username and password combination, print “Successful login!” and end the program.

Suppose the username is "Javalover123" and password is "javanumber1" (without quotes)

Hint: use 2 sentinel values, except both have to be correct (if either one are wrong, it is not a successful login)

Submit your code here.
*
1 point
(Optional) Add two additional user logins to your program (you may create your own usernames/passwords).

Submit your updated code here.
0 points
Add a security feature where there are a maximum number of failed attempts (let's say 5 attempts) before the system locks the login process (print “You have reached your maximum attempts to log in.” and end program).

Hint: count how many times the user inputted and possibly use a break statement.

Submit your updated code here.
*
1 point
Submit
Clear form
Never submit passwords through Google Forms.
This content is neither created nor endorsed by Google. Report Abuse - Terms of Service - Privacy Policy