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 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
|
import java.util.Scanner;
public class Convention {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
double f;
//String anglaise,mondiale;
String [] unite={"foot","pound","inch"};
char rep='o';
System.out.println(" ------------------------------------------------------------------------");
System.out.println("| CONVERSION ANGLAISE ==> MONDIALE |");
System.out.println(" ------------------------------------------------------------------------");
System.out.println("veuillez choisir l'unite foot/pound/inch");
while(rep=='o'){
String un=sc.nextLine();
System.out.println("veuillez entrer le nombre a convertir");
f=sc.nextDouble();
if(un.equals(unite[0])){
System.out.println("LE resultat est "+f+" foot vaut en Centimètre "+ f*30.48);
System.out.println("voulez vous continuez o/n");
rep=sc.nextLine().charAt(0);
}
if(un.equals(unite[1])){
System.out.println("LE resultat est "+f+" pound vaut en Centimètre "+ f*0.45);
System.out.println("voulez vous continuez o/n");
rep=sc.nextLine().charAt(0);
}
if(un.equals(unite[2])){
System.out.println("LE resultat est "+f+" inch vaut en Centimètre "+ f*2.45);
System.out.println("voulez vous continuez o/n");
rep=sc.nextLine().charAt(0);
}
while(rep !='o' && rep != 'n'){
System.out.println("voulez vous r�essayer(o/n)");
rep = sc.nextLine().charAt(0);
}
}
}
} |