-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExoS77.java
More file actions
47 lines (40 loc) · 1.41 KB
/
Copy pathExoS77.java
File metadata and controls
47 lines (40 loc) · 1.41 KB
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
40
41
42
43
44
45
46
47
package exos.instructions;
import java.util.Scanner;
/**
Exercice S77 : Candidature
1. Ecrire un programme qui permet de vérifier si un profil est valable pour une candidature
2. Le profil contient trois critères :
age : supérieur à 30 ans
salaire demandé : maximum 40 000€
années d'expériences : minimum 5 ans
3. Afficher un message pour chaque condition non respectée
*/
public class ExoS77 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int age, salaire, exp;
boolean estEmbauchable = true;
System.out.println("Entrez votre âge :");
age = scanner.nextInt();
System.out.println("Entrez votre salaire annuel souhaité :");
salaire = scanner.nextInt();
System.out.println("Entrez votre nombre d'années d'expérience :");
exp = scanner.nextInt();
if (age <= 30 ) {
System.out.println("Vous êtes trop jeune");
estEmbauchable = false;
}
if (salaire > 40000) {
System.out.println("Vos prétentions salariales sont trop élevées");
estEmbauchable = false;
}
if (exp < 5) {
System.out.println("Vous manquez d'expérience");
estEmbauchable = false;
}
if (estEmbauchable) {
System.out.println("Candidature acceptée");
}
scanner.close();
}
}