-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathif3.java
More file actions
35 lines (23 loc) · 690 Bytes
/
Copy pathif3.java
File metadata and controls
35 lines (23 loc) · 690 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
package LacosCondicionais;
import java.util.Scanner;
public class if3 {
public static void main(String[] args) {
Scanner leia = new Scanner (System.in);
String nome;
boolean apto;
int idade;
System.out.println("\nDigite o seu nome: ");
nome = leia.nextLine();
System.out.println("\nDigite sua idade: ");
idade = leia.nextInt();
System.out.println("\nPrimeira doação de sangue ?");
apto = leia.nextBoolean();
if(idade>=18 && idade<=69) {
if(idade>=60 && idade<=69 && apto){
System.out.println(nome+" Você não está apto para doar sangue!");
}else{
System.out.println(nome+" Você está apto para doar sangue!");
}
}
}
}