-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexo3.java
More file actions
24 lines (19 loc) · 760 Bytes
/
Copy pathexo3.java
File metadata and controls
24 lines (19 loc) · 760 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
import java.util.Scanner;
public class exo3 {
public static void main (String[]args){
//scanner pour lire l'entrée
Scanner scanner = new Scanner(System.in);
// demande a l'utilisateur de saisir le prix HT de l'unité
System.out.println("veuillez saisir un le prixHT : ");
int prixHT = scanner.nextInt();
// demande de la tva
System.out.println("veuillez saisir un la tva (sous forme o.2) : ");
double tva = scanner.nextDouble();
// calcul du prixTTC
double prixTTC = prixHT * (1 + tva );
//affichage print
System.out.println("le prix total est : " + prixTTC);
// fermer scanner
scanner.close();
}
}