This commit is contained in:
		
							
								
								
									
										18
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								README.md
									
									
									
									
									
								
							| @@ -1,18 +0,0 @@ | ||||
| ## Getting Started | ||||
|  | ||||
| Welcome to the VS Code Java world. Here is a guideline to help you get started to write Java code in Visual Studio Code. | ||||
|  | ||||
| ## Folder Structure | ||||
|  | ||||
| The workspace contains two folders by default, where: | ||||
|  | ||||
| - `src`: the folder to maintain sources | ||||
| - `lib`: the folder to maintain dependencies | ||||
|  | ||||
| Meanwhile, the compiled output files will be generated in the `bin` folder by default. | ||||
|  | ||||
| > If you want to customize the folder structure, open `.vscode/settings.json` and update the related settings there. | ||||
|  | ||||
| ## Dependency Management | ||||
|  | ||||
| The `JAVA PROJECTS` view allows you to manage your dependencies. More details can be found [here](https://github.com/microsoft/vscode-java-dependency#manage-dependencies). | ||||
										
											Binary file not shown.
										
									
								
							| @@ -1,10 +0,0 @@ | ||||
| package POO.T0_introduction; | ||||
|  | ||||
| public class Rectangle { | ||||
|   int width; | ||||
|   int height; | ||||
|    | ||||
|   public int area() { | ||||
|     return width * height; | ||||
|   } | ||||
| } | ||||
| @@ -1,25 +0,0 @@ | ||||
| package POO.T0_introduction; | ||||
|  | ||||
| public class RectangleDemoBegin { | ||||
|    | ||||
|     public static void main(String args[]) {       | ||||
|       Rectangle r1 = new Rectangle(); | ||||
|       r1.height = 4; | ||||
|       r1.width = 4; | ||||
|        | ||||
|       Rectangle r2 = new Rectangle(); | ||||
|       r2.height = 5; | ||||
|       r2.width = 6; | ||||
|        | ||||
|       Rectangle r3 = new Rectangle(); | ||||
|       r3.height = 2; | ||||
|       r3.width = 2; | ||||
|        | ||||
|       int totalArea = r1.area(); | ||||
|       totalArea += r2.area(); | ||||
|       totalArea += r3.area(); | ||||
|        | ||||
|       System.out.println(totalArea); | ||||
|        | ||||
|     } | ||||
|   } | ||||
										
											Binary file not shown.
										
									
								
							| @@ -1,17 +0,0 @@ | ||||
| package POO.T1_classes_et_objets; | ||||
|  | ||||
| public class Car { | ||||
|     String color = ""; | ||||
|     String type = ""; | ||||
|     int maxSpeed; | ||||
|  | ||||
|     public String getStringRepresentation() { | ||||
|         String s = type; | ||||
|         s += " "; | ||||
|         s += color; | ||||
|         s += ", vitesse max: "; | ||||
|         s += maxSpeed; | ||||
|         s += "km/h"; | ||||
|         return s; | ||||
|     } | ||||
| } | ||||
| @@ -1,16 +0,0 @@ | ||||
| Objectifs | ||||
|     Créer une classe | ||||
|     Tester la classe | ||||
| Enoncé du problème | ||||
|     Nous souhaitons créer une classe devant représenter une personne. Une personne possède les attributs suivants : | ||||
|         Nom | ||||
|         Prénom | ||||
|         Âge | ||||
|         Taille | ||||
|  | ||||
| Travail à faire | ||||
|     Créer la classe Person avec les attributs nécessaires | ||||
|     Dans une autre classe qui contiendra votre main : | ||||
|         Instanciez une première personne de 19 ans, nommée "John Doe", mesurant 1.75 m | ||||
|         Instanciez une second personne de 122 ans, nommée "Mathusalem", dont la taille est de 1.20 m | ||||
|     Vérifiez que tout fonctionne bien avec ces deux objets. Notamment, essayez d’imprimer le nom des personnes lorsque vous les aurez instanciées. | ||||
| @@ -1,23 +0,0 @@ | ||||
| Objectifs | ||||
|     Créer une classe | ||||
|     Tester une classe | ||||
|     Tester les méthodes de classes existantes (avec la classe String) | ||||
| Enoncé du problème | ||||
|     On souhaite réaliser une classe pour modéliser une voiture. Pensez quels types d’attributs cette classe doit posséder, sachant | ||||
|         Un véhicule est caractérisé par sa couleur, son nom et sa vitesse maximale. | ||||
|         Un véhicule possède une méthode permettant de retourner sa représentation textuelle. Par exemple le code suivant : | ||||
|  | ||||
|     Car c1 = new Car(); | ||||
|     c1.color = "bleue"; | ||||
|     c1.maxSpeed = 250; | ||||
|     c1.type = "Ford Raptor"; | ||||
|     System.out.println(c1.getStringRepresentation()); | ||||
|  | ||||
|     doit afficher | ||||
|  | ||||
|     Ford Raptor bleue, vitesse max : 250 km/h | ||||
|  | ||||
| Travail à faire | ||||
|     Implémentez la classe Car selon les instructions ci-dessus. | ||||
|     Testez votre classe Car dans une autre classe qui contiendra le main. | ||||
|     Vérifiez que l’affichage est bien correct. | ||||
| @@ -1,13 +0,0 @@ | ||||
| package POO.T1_classes_et_objets; | ||||
|  | ||||
| public class Exercice2 { | ||||
|     public static void main(String[] args) { | ||||
|  | ||||
|         Car c1 = new Car(); | ||||
|         c1.color = "bleue"; | ||||
|         c1.maxSpeed = 250; | ||||
|         c1.type = "Ford Raptor"; | ||||
|         System.out.println(c1.getStringRepresentation()); | ||||
|          | ||||
|     } | ||||
| } | ||||
| @@ -1,19 +0,0 @@ | ||||
| package POO.T1_classes_et_objets; | ||||
|  | ||||
| public class Person { | ||||
|     String surname; // Nom de famille | ||||
|     String name; // Prénom | ||||
|     int age; // Âge | ||||
|     double height; // Taille | ||||
|  | ||||
|     public void print() { | ||||
|         System.out.print(name); | ||||
|         System.out.print(" "); | ||||
|         System.out.print(surname); | ||||
|         System.out.print(", "); | ||||
|         System.out.print(age); | ||||
|         System.out.print(", "); | ||||
|         System.out.print(height); | ||||
|         System.out.println("m."); | ||||
|     } | ||||
| } | ||||
| @@ -1,24 +0,0 @@ | ||||
| package POO.T1_classes_et_objets; | ||||
|  | ||||
| public class exercice1 { | ||||
|     public static void main(String[] args) { | ||||
|          | ||||
|         Person john; | ||||
|         john = new Person(); | ||||
|  | ||||
|         john.surname = "Doe"; | ||||
|         john.name = "John"; | ||||
|         john.age = 19; | ||||
|         john.height = 1.75; | ||||
|  | ||||
|         Person mathusalem = new Person(); | ||||
|  | ||||
|         mathusalem.name = "Mathusalem"; | ||||
|         mathusalem.age = 122; | ||||
|         mathusalem.height = 1.2; | ||||
|  | ||||
|         john.print(); | ||||
|         mathusalem.print(); | ||||
|  | ||||
|     } | ||||
| } | ||||
										
											Binary file not shown.
										
									
								
							| @@ -1,23 +0,0 @@ | ||||
| package POO.T2_constructeurs; | ||||
|  | ||||
| public class Car { | ||||
|     String color = ""; | ||||
|     String type = ""; | ||||
|     int maxSpeed; | ||||
|  | ||||
|     public Car(String type, String color, int maxSpeed){ | ||||
|         this.type = type; | ||||
|         this.color = color; | ||||
|         this.maxSpeed = maxSpeed; | ||||
|     } | ||||
|  | ||||
|     public String getStringRepresentation() { | ||||
|         String s = type; | ||||
|         s += " "; | ||||
|         s += color; | ||||
|         s += ", vitesse max: "; | ||||
|         s += maxSpeed; | ||||
|         s += "km/h"; | ||||
|         return s; | ||||
|     } | ||||
| } | ||||
| @@ -1,19 +0,0 @@ | ||||
| Objectif | ||||
|     Ajouter un constructeur à une classe existante | ||||
|     Tester une classe avec son constructeur | ||||
| Enoncé du problème | ||||
|     1. Ajoutez à la classe Car définie auparavant un constructeur permettant d’instancier la voiture en une seule ligne de code, avec tous ses attributs comme ci-dessous. | ||||
|     2. Utilisez ce constructeur pour créer une instance de la classe. | ||||
|  | ||||
|     Car c1 = new Car("Ford Raptor", "bleue", 250); | ||||
|     System.out.println(c1.getStringRepresentation()); | ||||
|  | ||||
|     doit afficher | ||||
|  | ||||
|     Ford Raptor bleue, vitesse max : 250 km/h | ||||
|  | ||||
|  | ||||
| Travail à faire | ||||
|     Modifiez la classe Car selon les instructions ci-dessus. | ||||
|     Testez votre classe Car dans une autre classe qui contiendra le main. | ||||
|     Vérifiez que l’affichage est bien correct. | ||||
| @@ -1,12 +0,0 @@ | ||||
| Objectif | ||||
|     Ajouter plusieurs constructeurs à une classe existante | ||||
|     Tester une classe avec son constructeur | ||||
|     Constater l’existance de null | ||||
| Enoncé du problème | ||||
|     Ajoutez deux constructe urs à la class Person définie auparavant. | ||||
|         1. Le premier permettant de définir tous les attributs en une fois. | ||||
|         2. Un second constructeur ne prenant que le prénom comme argument. Ce constructeur doit appeler le constructeur avec tous les arguments. Pour les String non définis, utilisez la constante null. | ||||
| Travail à faire | ||||
|     Complétez la classe Person selon les instructions ci-dessus. | ||||
|     Testez votre classe Person dans une autre classe qui contiendra le main. | ||||
|     Utilisez le constructeur à un argument pour instancier Mathusalem, qui n’a pas de prénom. Que se passe-t-il lorsque vous essayer d’appeler une méthode sur le prénom de votre objet, par exemple toUpperCase() qui est une méthode définie pour les String ? | ||||
| @@ -1,10 +0,0 @@ | ||||
| package POO.T2_constructeurs; | ||||
|  | ||||
| public class Exercice3 { | ||||
|     public static void main(String[] args) { | ||||
|          | ||||
|         Car c1 = new Car("Ford Raptor", "bleue", 250); | ||||
|         System.out.println(c1.getStringRepresentation()); | ||||
|  | ||||
|     } | ||||
| } | ||||
| @@ -1,13 +0,0 @@ | ||||
| package POO.T2_constructeurs; | ||||
|  | ||||
| public class Exercice4 { | ||||
|     public static void main(String[] args) { | ||||
|         Person john = new Person("John", "Doe", 19, 1.75); | ||||
|         john.print(); | ||||
|  | ||||
|         Person momo = new Person("Mathusalem"); | ||||
|         momo.print(); | ||||
|         momo.surname.toUpperCase(); | ||||
|         momo.print();; | ||||
|     } | ||||
| } | ||||
| @@ -1,30 +0,0 @@ | ||||
| package POO.T2_constructeurs; | ||||
|  | ||||
| public class Person { | ||||
|     String surname = ""; // Nom de famille | ||||
|     String name = ""; // Prénom | ||||
|     int age; // Âge | ||||
|     double height; // Taille | ||||
|  | ||||
|     public Person(String name, String surname, int age, double height){ | ||||
|         this.surname = surname; | ||||
|         this.name = name; | ||||
|         this.age = age; | ||||
|         this.height = height; | ||||
|     } | ||||
|  | ||||
|     public Person(String name){ | ||||
|         this(name, "", 0, 0); | ||||
|     } | ||||
|  | ||||
|     public void print() { | ||||
|         System.out.print(name); | ||||
|         System.out.print(" "); | ||||
|         System.out.print(surname); | ||||
|         System.out.print(", "); | ||||
|         System.out.print(age); | ||||
|         System.out.print(", "); | ||||
|         System.out.print(height); | ||||
|         System.out.println("m."); | ||||
|     } | ||||
| } | ||||
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							| @@ -1,14 +0,0 @@ | ||||
| package POO.T3_Visibilite_des_membres; | ||||
|  | ||||
| public class Exercice5 { | ||||
|     public static void main(String[] args) { | ||||
|          | ||||
|         Triangle t = new Triangle(5, 2); | ||||
|         System.out.println(t.computeArea()); | ||||
|         System.out.println(computeTriangleArea(t)); | ||||
|     } | ||||
|  | ||||
|     public static double computeTriangleArea(Triangle t){ | ||||
|         return (t.base*t.hauteur)/2; | ||||
|     } | ||||
| } | ||||
| @@ -1,15 +0,0 @@ | ||||
| package POO.T3_Visibilite_des_membres; | ||||
|  | ||||
| public class Triangle { | ||||
|     double base; | ||||
|     double hauteur; | ||||
|  | ||||
|     Triangle(double base, double hauteur){ | ||||
|         this.base = base; | ||||
|         this.hauteur = hauteur; | ||||
|     } | ||||
|  | ||||
|     public double computeArea(){ | ||||
|         return (base*hauteur)/2; | ||||
|     } | ||||
| } | ||||
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							| @@ -1,17 +0,0 @@ | ||||
| package POO.T5_autoboxing_des_types_primitifs; | ||||
|  | ||||
| public class Main { | ||||
|     public static void main(String[] args) { | ||||
|         //Integer foo = new Integer(15); | ||||
|         //System.out.println(foo.toHexString(foo.intValue())); | ||||
|         String s = "12"; | ||||
|         System.out.println(Integer.parseInt(s)+5); | ||||
|         int bar = 17; | ||||
|         Integer barInteger = bar; | ||||
|         System.out.println(barInteger+2); | ||||
|         Double foobarDouble = 3.0; | ||||
|         double foobar = foobarDouble; | ||||
|         System.out.println(foobar); | ||||
|  | ||||
|     } | ||||
| } | ||||
										
											Binary file not shown.
										
									
								
							| @@ -1,20 +0,0 @@ | ||||
| package series.C05S03_loops; | ||||
|  | ||||
| import various_tests.Input; | ||||
|  | ||||
| public class C05EX01a { | ||||
|     public static void main(String[] args) { | ||||
|          | ||||
|         int a, b, c; | ||||
|         System.out.print("Veuillez entrer la première valeur: "); | ||||
| 		a = Input.readInt(); | ||||
| 		System.out.print("Veuillez entrer la deuxième valeur: "); | ||||
| 		b = Input.readInt(); | ||||
| 		System.out.print("Veuillez entrer la troisième valeur: "); | ||||
| 		c = Input.readInt(); | ||||
|         int max = a>b ? a:b; | ||||
|         max = max>c ? max:c; | ||||
|         System.out.println(max); | ||||
|  | ||||
|     } | ||||
| } | ||||
| @@ -1,14 +0,0 @@ | ||||
| package series.C05S03_loops; | ||||
|  | ||||
| import various_tests.Input; | ||||
|  | ||||
| public class C05EX01b { | ||||
|     public static void main(String[] args) { | ||||
|         double a = Input.readDouble(); | ||||
|         if (a>=0) { | ||||
|             System.out.println(Math.sqrt(a)); | ||||
|         } else { | ||||
|             System.out.println("error"); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @@ -1,12 +0,0 @@ | ||||
| package series.C05S03_loops; | ||||
|  | ||||
| public class C05EX02 { | ||||
|     public static void main(String[] args) { | ||||
|          | ||||
|         int x = 0; | ||||
|         for (int i = 0; i < 10; i++) { | ||||
|             x = i+1; | ||||
|             System.out.println(x); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @@ -1,22 +0,0 @@ | ||||
| package series.C05S03_loops; | ||||
|  | ||||
| public class C05EX03 { | ||||
|     public static void wait(int ms) | ||||
| { | ||||
|     try | ||||
|     { | ||||
|         Thread.sleep(ms); | ||||
|     } | ||||
|     catch(InterruptedException ex) | ||||
|     { | ||||
|         Thread.currentThread().interrupt(); | ||||
|     } | ||||
| } | ||||
|     public static void main(String[] args) { | ||||
|         int x = 2147483640; | ||||
|         for (int i = 0; i < 10; x++) { | ||||
|             System.out.println(x); | ||||
|             wait(100); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @@ -1,10 +0,0 @@ | ||||
| package series.C05S03_loops; | ||||
|  | ||||
| public class C05EX04a { | ||||
|     public static void main(String[] args) { | ||||
|         int foo =4; | ||||
|         for (foo = 10; foo >=0; foo = foo - 3) { | ||||
|             System.out.println(foo); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @@ -1,11 +0,0 @@ | ||||
| package series.C05S03_loops; | ||||
|  | ||||
| public class C05EX04c { | ||||
|     public static void main(String[] args) { | ||||
|         int foo = 10; | ||||
|         while (foo>=0) { | ||||
|             System.out.println(foo); | ||||
|             foo -= 3; | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @@ -1,11 +0,0 @@ | ||||
| package series.C05S03_loops; | ||||
|  | ||||
| public class C05EX04d { | ||||
|     public static void main(String[] args) { | ||||
|         int foo = 10; | ||||
|         do { | ||||
|             System.out.println(foo); | ||||
|             foo-=3; | ||||
|         } while (foo>=0); | ||||
|     } | ||||
| } | ||||
| @@ -1,11 +0,0 @@ | ||||
| package series.C05S03_loops; | ||||
|  | ||||
| public class C05EX07 { | ||||
|     public static void main(String[] args) { | ||||
|         int i = 0; | ||||
|         while (i<=20) { | ||||
|             i++; | ||||
|             System.out.println(i); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @@ -1,13 +0,0 @@ | ||||
| package series.C05S03_loops; | ||||
|  | ||||
| public class C05EX08a { | ||||
|     public static void main(String[] args) { | ||||
|          | ||||
|         int sum = 0; | ||||
|         for (int i = 0; i <= 1000; i++) { | ||||
|             sum += i; | ||||
|         } | ||||
|         System.out.println(sum); | ||||
|  | ||||
|     } | ||||
| } | ||||
| @@ -1,13 +0,0 @@ | ||||
| package series.C05S03_loops; | ||||
|  | ||||
| public class C05EX08b { | ||||
|     public static void main(String[] args) { | ||||
|         double sum = 0; | ||||
|         int i; | ||||
|         for (i = 0; i <= 1000; i++) { | ||||
|             sum += i; | ||||
|         } | ||||
|         double average = sum/(i-1); | ||||
|         System.out.println(average); | ||||
|     } | ||||
| } | ||||
| @@ -1,9 +0,0 @@ | ||||
| package series.C05S03_loops; | ||||
|  | ||||
| public class C05EX08c { | ||||
|     public static void main(String[] args) { | ||||
|         for (int i = 3; i < 100; i+=3) { | ||||
|             System.out.println(i); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @@ -1,11 +0,0 @@ | ||||
| package series.C05S03_loops; | ||||
|  | ||||
| public class C05EX08d { | ||||
|     public static void main(String[] args) { | ||||
|         for (int i = -5; i <= 5; i++) { | ||||
|             if (i!=0) { | ||||
|                 System.out.println(i); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @@ -1,14 +0,0 @@ | ||||
| package series.C05S03_loops; | ||||
|  | ||||
| public class C05EX08e { | ||||
|     public static void main(String[] args) { | ||||
|         String s = ""; | ||||
|         for (int i = 0; i < 6; i++) { | ||||
|             for (int j = 0; j <= i; j++) { | ||||
|                 s += "*"; | ||||
|             } | ||||
|             s += "-"; | ||||
|             System.out.println(s); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @@ -1,11 +0,0 @@ | ||||
| package series.C05S03_loops; | ||||
|  | ||||
| public class C05EX08f { | ||||
|     public static void main(String[] args) { | ||||
|         for (int i = 333; i <= 389; i++) { | ||||
|             if (i%2==0) { | ||||
|                 System.out.println(i); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| } | ||||
										
											Binary file not shown.
										
									
								
							| @@ -1,40 +0,0 @@ | ||||
| package series.C06S04_fonctions; | ||||
|  | ||||
| import hevs.utils.Input; | ||||
|  | ||||
| public class C05EX01 { | ||||
|  | ||||
|     // a | ||||
|     public static float cube(float x) { | ||||
|         return x*x*x; | ||||
|     } | ||||
|  | ||||
|     // b | ||||
|     public static double puissance(int base, int exposant) { | ||||
|         double resultat = 1.0; | ||||
|         for (int i = 0; i < exposant; i++) { | ||||
|             resultat *= base; | ||||
|         } | ||||
|         return resultat; | ||||
|     } | ||||
|  | ||||
|     // c | ||||
|     public static void f1() { | ||||
|     } | ||||
|  | ||||
|     // d | ||||
|     public static int NbrLettre(String s) { | ||||
|         return 0;         | ||||
|     } | ||||
|  | ||||
|     // e | ||||
|     public static boolean f2(int x1, int x2, String s) { | ||||
|         return false; | ||||
|     } | ||||
|  | ||||
|     public static void main(String[] args) { | ||||
|         int base = Input.readInt(); | ||||
|         int exposant = Input.readInt(); | ||||
|         System.out.println(puissance(base, exposant)); | ||||
|     } | ||||
| } | ||||
										
											Binary file not shown.
										
									
								
							| @@ -1,16 +0,0 @@ | ||||
| package series.theorie; | ||||
|  | ||||
| import various_tests.Input; | ||||
|  | ||||
| public class C04EX0501 { | ||||
|  | ||||
|     public static void main(String[] args) { | ||||
|         int a = Input.readInt(); | ||||
|         if (a>=0) { | ||||
|             System.out.println(a); | ||||
|         } else { | ||||
|             System.out.println(-a); | ||||
|         } | ||||
|     } | ||||
|      | ||||
| } | ||||
| @@ -1,23 +0,0 @@ | ||||
| package series.theorie; | ||||
|  | ||||
| import various_tests.Input; | ||||
|  | ||||
| public class C04EX0502 { | ||||
|     public static void main(String[] args) { | ||||
|         while (true) { | ||||
|             int a = Input.readInt(); | ||||
|             boolean b = false; | ||||
|  | ||||
|             if (a%2 == 0) { | ||||
|                 b = true; | ||||
|             } | ||||
|  | ||||
|             if(b){ | ||||
|                 System.out.println("La variable est paire"); | ||||
|             } else { | ||||
|                 System.out.println("La variable est impaire"); | ||||
|             } | ||||
|         } | ||||
|          | ||||
|     } | ||||
| } | ||||
| @@ -1,20 +0,0 @@ | ||||
| package series.theorie; | ||||
|  | ||||
| import various_tests.Input; | ||||
|  | ||||
| public class C05EX01a { | ||||
|     public static void main(String[] args) { | ||||
|          | ||||
|         int a, b, c; | ||||
|         System.out.print("Veuillez entrer la première valeur: "); | ||||
| 		a = Input.readInt(); | ||||
| 		System.out.print("Veuillez entrer la deuxième valeur: "); | ||||
| 		b = Input.readInt(); | ||||
| 		System.out.print("Veuillez entrer la troisième valeur: "); | ||||
| 		c = Input.readInt(); | ||||
|         int max = a>b ? a:b; | ||||
|         max = max>c ? max:c; | ||||
|         System.out.println(max); | ||||
|  | ||||
|     } | ||||
| } | ||||
| @@ -1,14 +0,0 @@ | ||||
| package series.theorie; | ||||
|  | ||||
| import various_tests.Input; | ||||
|  | ||||
| public class C05EX01b { | ||||
|     public static void main(String[] args) { | ||||
|         double a = Input.readDouble(); | ||||
|         if (a>=0) { | ||||
|             System.out.println(Math.sqrt(a)); | ||||
|         } else { | ||||
|             System.out.println("error"); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @@ -1,12 +0,0 @@ | ||||
| package series.theorie; | ||||
|  | ||||
| public class C05EX02 { | ||||
|     public static void main(String[] args) { | ||||
|          | ||||
|         int x = 0; | ||||
|         for (int i = 0; i < 10; i++) { | ||||
|             x = i+1; | ||||
|             System.out.println(x); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @@ -1,19 +0,0 @@ | ||||
| package series.theorie; | ||||
| import hevs.utils.Input; | ||||
|  | ||||
| public class C06EX06 { | ||||
|  | ||||
|     public static int somme(int x1, int x2, int x3){ | ||||
|             return x1+x2+x3; | ||||
|     } | ||||
|  | ||||
|     public static double petit(double x1, double x2) { | ||||
|         return x1<x2?x1:x2; | ||||
|     } | ||||
|  | ||||
|     public static void main(String[] args) { | ||||
|         System.out.println("La somme est: " + somme(Input.readInt(), Input.readInt(), Input.readInt())); | ||||
|         System.out.println("Le plus petit nombre est: " + petit(Input.readDouble(), Input.readDouble())); | ||||
|     } | ||||
|      | ||||
| } | ||||
		Reference in New Issue
	
	Block a user