-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExer02.java
More file actions
41 lines (23 loc) · 794 Bytes
/
Exer02.java
File metadata and controls
41 lines (23 loc) · 794 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package com.laiane.cursojava.aula17;
import java.util.Scanner;
public class Exer02 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
boolean infoInvalidas = false;
String nomeUser;
String senha;
do {
System.out.println("Entre com o nome de usuário:");
nomeUser = scan.next();
System.out.println("Entre com a senha:");
senha = scan.next();
if (nomeUser.equalsIgnoreCase(senha)){
//infoValidas = false;
System.out.println("Senha igual a usuário, digite novamente.");
} else {
var infoValidas = true;
System.out.println("Senha e usuários válidos");
}
} while (!infoInvalidas);
}
}