Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

PreAP Computer Science: Enter Password Lab

Rating
-
Sold
-
Pages
1
Grade
A+
Uploaded on
28-01-2023
Written in
2022/2023

Set up a password variable and assign a password to this variable. Run your program and type in invalid passwords to check and see if your Boolean logic is correct...

Institution
Senior / 12th Grade
Course
Computer Science

Content preview

import java.util.Scanner;
import static java.lang.System.*;

public class EnterPassword
{
public static void main( String[] args )
{
Scanner keyboard = new Scanner( System.in );
String pw = "mchammergohammer";
String enter;
do {
out.print("Enter the password :: ");
enter = keyboard.next();
if (enter.equals(pw)) {
out.println("VALID");
break; }
else {
out.println("INVALID"); }
} while(enter != pw);
}
}

Written for

Institution
Senior / 12th grade
Course
Computer Science
School year
4

Document information

Uploaded on
January 28, 2023
Number of pages
1
Written in
2022/2023
Type
Exam (elaborations)
Contains
Questions & answers
$11.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
coolninjafire
5.0
(1)

Also available in package deal

Thumbnail
Package deal
PreAP Computer Science: All Java Labs [FULL CODES]
-
9 2023
$ 100.41 More info

Get to know the seller

Seller avatar
coolninjafire
View profile
Follow You need to be logged in order to follow users or courses
Sold
6
Member since
3 year
Number of followers
2
Documents
84
Last sold
11 months ago
Saving Students from Stress (SSS)

Aiding high school students with their coursework

5.0

1 reviews

5
1
4
0
3
0
2
0
1
0

Trending documents

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions