Refonte du repo

This commit is contained in:
JunkJumper 2020-05-20 17:01:49 +02:00
parent 4962efbd17
commit 45f4d2dffe
165 changed files with 83943 additions and 84353 deletions

View File

@ -1,32 +0,0 @@
{
"configurations": [
{
"type": "java",
"name": "CodeLens (Launch) - LectureFichierAffichage",
"request": "launch",
"mainClass": "input.LectureFichierAffichage",
"projectName": "TD10"
},
{
"type": "java",
"name": "CodeLens (Launch) - Partie",
"request": "launch",
"mainClass": "pokemon.Partie",
"projectName": "TD10"
},
{
"type": "java",
"name": "CodeLens (Launch) - LectureFichierEcritureESP",
"request": "launch",
"mainClass": "input.LectureFichierEcritureESP",
"projectName": "TD10"
},
{
"type": "java",
"name": "CodeLens (Launch) - LectureFichier",
"request": "launch",
"mainClass": "input.LectureFichier",
"projectName": "TD10"
}
]
}

View File

@ -1,87 +0,0 @@
package tripletEntier;
public class TripletEntier
{
private int un;
private int deux;
private int trois;
public TripletEntier()
{
un = 0;
deux = 0;
trois = 0;
}
public TripletEntier(int a, int b, int c)
{
un = a;
deux = b;
trois = c;
}
//getter
public int getA() {
return un;
}
public int getB() {
return deux;
}
public int getC() {
return trois;
}
//setter
public void setA(int a) {
this.un = a;
}
public void setB(int b) {
this.deux = b;
}
public void setC(int c) {
this.trois = c;
}
/*
¸,ø¤º°`°º¤ø,¸¸,ø¤º°°º¤ø,¸¸,ø¤º°`°º¤ø,¸
Exercices demandés
¸,ø¤º°`°º¤ø,¸¸,ø¤º°°º¤ø,¸¸,ø¤º°`°º¤ø,¸
*/
public int somme()
{
int ret=this.un+this.deux+this.trois;
return ret;
}
public String concatenation()
{
return ""+this.un+this.deux+this.trois;
}
public double moyenne()
{
return ((double) somme() / 3);
}
@Override
public String toString()
{
return "[a=" + un + ", b=" + deux + ", c=" + trois + "]";
}
public boolean equals(Object o)
{
TripletEntier t = (TripletEntier) o;
return (this.un == t.un) && (this.deux == t.deux) && (this.trois == t.trois);
}
}

View File

@ -1,39 +0,0 @@
package fleuriste;
/*-------------------------------------------------
Tableau Fleurs
0 = roses 1 = tulipes 2 = oeillets
--------------------------------------------------*/
public class Bouquet {
private LotFleur lotFleurs[];
public LotFleur getLotFleur(int i) {
return lotFleurs[i];
}
public void setLotFleur(LotFleur lotFleur, int i) {
this.lotFleurs[i] = lotFleur;
}
//instructions
public Bouquet(LotFleur l1, LotFleur l2, LotFleur l3){
lotFleurs[0] = l1;
lotFleurs[1] = l2;
lotFleurs[2] = l3;
}
public double prix() {
double resultat = 0.;
for (int i = 0; i < 3; i++) {
resultat = lotFleurs[i].getFleur().getPrix() * lotFleurs[i].getQuantite() + resultat;
}
return resultat;
}
}

View File

@ -1,33 +0,0 @@
package fleuriste;
public class Fleur {
private String nom;
private double prix;
//getters
public String getNom() {
return nom;
}
public void setNom(String nom) {
this.nom = nom;
}
//setters
public double getPrix() {
return prix;
}
public void setPrix(double prix) {
this.prix = prix;
}
//instructions
public Fleur(String nomFleur, double prixFleur) {
this.nom = nomFleur;
this.prix = prixFleur;
}
}

View File

@ -1,57 +0,0 @@
package fleuriste;
/*-------------------------------------------------
Tableau Fleurs
0 = roses 1 = tulipes 2 = oeillets
--------------------------------------------------*/
public class Stock {
private int[] quantite;
//getters
public int[] getQuantite() {
return quantite;
}
//setters
public void setQuantite(int[] quantite) {
this.quantite = quantite;
}
//Instructions
public Stock(Fleur f1, Fleur f2, Fleur f3) {
quantite[0] = 0;
quantite[1] = 0;
quantite[2] = 0;
}
public void ajouteFleur(int i, int quantiteFleur) {
if(i < 0 || i > 2)
{
System.err.println("Impossible, il n'y a pas de fleur de ce type !");
}
this.quantite[i] = quantiteFleur;
}
public boolean bouquetFaisable(Bouquet b1) {
for (int i = 0; i < 3; i++) {
if(quantite[i] > b1.getLotFleur(i).getQuantite())
{
return false;
}
}
return true;
}
}

View File

@ -1,28 +0,0 @@
package fleuriste;
public class TestBouquet {
public static void main( String[] args) {
// nom str nom = nom objet (ex :Tartampion)
Fleur rose = new Fleur("rose",2.6);
Fleur tulipe = new Fleur("tulipe",0.4);
Fleur oeillet = new Fleur("oeillet",1.8);
LotFleur lotroses = new LotFleur(rose,5);
LotFleur lottulipes = new LotFleur(tulipe,7);
LotFleur lotoeillets = new LotFleur(oeillet,3);
Bouquet b = new Bouquet(lotroses, lottulipes, lotoeillets);
double prixb = b.prix(); //calcule le prix d'un bouquet
System.out.println(b+" : "+prixb+" euros");
Stock magasin = new Stock(rose,tulipe,oeillet);
System.out.println(magasin);
magasin.ajouteFleur(0, 100);
magasin.ajouteFleur(1, 150);
magasin.ajouteFleur(2, 200);
System.out.println(magasin);
// Est-ce que le stock permet de produire le bouquet b ?
boolean orderBouquet = magasin.bouquetFaisable(b);
System.out.println(orderBouquet);
}
}

View File

@ -1,18 +0,0 @@
{
"configurations": [
{
"type": "java",
"name": "CodeLens (Launch) - TestPokemon",
"request": "launch",
"mainClass": "pkmA.TestPokemon",
"projectName": "TD6"
},
{
"type": "java",
"name": "CodeLens (Launch) - GestionVehicule",
"request": "launch",
"mainClass": "vehicule.GestionVehicule",
"projectName": "TD6"
}
]
}

Binary file not shown.

View File

@ -1,18 +0,0 @@
{
"configurations": [
{
"type": "java",
"name": "CodeLens (Launch) - TestPokemon",
"request": "launch",
"mainClass": "pokemon.TestPokemon",
"projectName": "TD8"
},
{
"type": "java",
"name": "CodeLens (Launch) - TestExercices",
"request": "launch",
"mainClass": "services.TestExercices",
"projectName": "TD8"
}
]
}

View File

@ -1,18 +0,0 @@
{
"configurations": [
{
"type": "java",
"name": "CodeLens (Launch) - TestPokemon",
"request": "launch",
"mainClass": "pokemon.TestPokemon",
"projectName": "TD9"
},
{
"type": "java",
"name": "CodeLens (Launch) - main",
"request": "launch",
"mainClass": "comparable.main",
"projectName": "TD9"
}
]
}

View File

@ -1,19 +0,0 @@
package pokemon;
enum Type {
EAU("EAU"),
ELECTRIK("ELECTRIK"),
FEU("FEU"),
PLANTE("PLANTE");
Type(String s) {
description = s;
}
private String description;
public String getDescription() {
return description;
}
}

View File

@ -1,102 +0,0 @@
package journey;
public class Point
{
//attributs
private double x;
private double y;
public List<Trajet> trajet = new ArrayList<Trajet> ();
//constructeurs
public Point()
{
x = 0;
y = 0;
}
public Point(double x, double y)
{
this.x = x;
this.y = y;
}
//methode d'instance
public String toString()
{
return "(X = " + this.x + " - Y = " + this.y + ")";
}
public double getDistance(Point p)
{
double result;
result = Math.sqrt(Math.pow(this.x - p.x, 2) + Math.pow(this.y - p.y, 2));
return result;
}
//accesseur en lecture
public double getX() {
return x;
}
public double getY() {
return y;
}
public Point projX()
{
return new Point(this.x, 0.);
}
public Point projY()
{
return new Point(0., this.y);
}
public boolean equals (Object obj)
{
Point p = (Point)obj;
if (this.x == p.x && this.y == p.y)
return true;
else return false;
}
public Point clone()
{
return new Point(this.x, this.y);
}
public void getLocation()
{
System.out.println("x = " + this.x + " , y = " + this.y + ".");
}
public void setLocation(Point p)
{
p.x = this.x;
p.y = this.y;
}
public void setLocation(double x, double y)
{
x = this.x;
y = this.y;
}
public void translate(int dx, int dy)
{
this.x = this.x+dx;
this.y = this.y+dy;
}
//getters and setters
public void setX(double x) {
this.x = x;
}
public void setY(double y) {
this.y = y;
}
}

View File

@ -1,32 +0,0 @@
package journey;
public class Trajet {
private String nom;
private Integer nombrePoints;
private int tabDistance[];
public int getTabDistance[]() {
return this.tabDistance[];
}
public void setTabDistance[](final int value) {
this.tabDistance[] = value;
}
public String getNom() {
return this.nom;
}
public void setNom(final String value) {
this.nom = value;
}
public Integer getNombrePoints() {
return this.nombrePoints;
}
public void sommeDistance() {
}
}

0
TD1/TD1.pdf → TDs/TD1.pdf Executable file → Normal file
View File

0
TD10/TD10.pdf → TDs/TD10.pdf Executable file → Normal file
View File

0
TD2/TD2.pdf → TDs/TD2.pdf Executable file → Normal file
View File

0
TD3/TD3.pdf → TDs/TD3.pdf Executable file → Normal file
View File

0
TD4/TD4.pdf → TDs/TD4.pdf Executable file → Normal file
View File

0
TD5/TD5.pdf → TDs/TD5.pdf Executable file → Normal file
View File

0
TD6/TD6.pdf → TDs/TD6.pdf Executable file → Normal file
View File

0
TD7/TD7.pdf → TDs/TD7.pdf Executable file → Normal file
View File

0
TD8/TD8.pdf → TDs/TD8.pdf Executable file → Normal file
View File

0
TD9/TD9.pdf → TDs/TD9.pdf Executable file → Normal file
View File

0
TD1/src/HelloWorld.java → src/TD1/HelloWorld.java Executable file → Normal file
View File

0
TD1/src/point/Point.java → src/TD1/point/Point.java Executable file → Normal file
View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

@ -15,13 +15,13 @@ public class TestTripletEntier
TripletEntier t2 = new TripletEntier(1, 2, 3);
System.out.println(t2);
/*String resConcat = t2.concatenation();
String resConcat = t2.concatenation();
/*System.out.println(resConcat);
System.out.println(resConcat);
System.out.println(resConcat == "123");
System.out.println(resConcat.equals("123"));
System.out.println("Moyenne "+t2+" = "+t2.moyenne());
System.out.println();*/
System.out.println();
System.out.println(new TripletEntier(1, 2, 4).moyenne());
System.out.println();
@ -32,10 +32,12 @@ public class TestTripletEntier
System.out.println(t3.moyenne() == 1.666667);
System.out.println();
/*t1.ajoutElement(5, 2);
/*
t1.ajoutElement(5, 2);
System.out.println(t1);
t1.ajoutElement(5, 5);
t1.ajout1erElement(10);
System.out.println(t1);*/
System.out.println(t1);
*/
}
}

View File

@ -0,0 +1,52 @@
package tripletEntier;
public class TripletEntier {
private int unA;
private int unB;
private int unC;
public TripletEntier(int a, int b, int c) {
this.unA = a;
this.unB = b;
this.unC = c;
}
public TripletEntier() {
}
public int somme() {
return this.unA + this.unB + this.unC;
}
public float moyenne() {
return (float)this.somme()/3;
}
public String concatenation() {
return "" + this.unA + this.unB + this.unC;
}
public void ajoutElement(int e) {
this.unA = e;
}
public boolean contient(int e) {
return (this.unA == e) || (this.unB == e) || (this.unC == e);
}
public boolean equals(TripletEntier t) {
return (this.unA == t.unA) && (this.unB == t.unB) && (this.unC == t.unC);
}
public TripletEntier clone(TripletEntier t) {
return new TripletEntier(t.unA, t.unB, t.unC);
}
@Override
public String toString() {
return "[" + this.unA + "," + this.unB + "," + this.unC +"]";
}
}

0
TD3 src/boite/Boite.java → src/TD3/boite/Boite.java Executable file → Normal file
View File

0
TD3 src/boite/Objet.java → src/TD3/boite/Objet.java Executable file → Normal file
View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

0
TD6/src/pkmA/Type.java → src/TD6/pkmA/Type.java Executable file → Normal file
View File

Some files were not shown because too many files have changed in this diff Show More