diff --git a/DEV2.1/CM1 (copy 1)/Exercice 2/Deduction.java b/DEV2.1/CM1 (copy 1)/Exercice 2/Deduction.java new file mode 100644 index 0000000..9dbd78b --- /dev/null +++ b/DEV2.1/CM1 (copy 1)/Exercice 2/Deduction.java @@ -0,0 +1,36 @@ +//MELIANI SAMY (TP1) +public class Deduction{ + public static void main(String[] args) { + Deduction2 compte = new Deduction2(); + compte.voir(); + compte.crediter(); + compte.crediter(); + compte.crediter(); + compte.crediter(); + compte.crediter(); + compte.vider(); + compte.crediter(); + compte.crediter(); + compte.crediter(); + compte.crediter(); + compte.crediter(); + compte.crediter(); + compte.crediter(); + compte.crediter(); + compte.crediter(); + compte.crediter(); + System.out.println(compte.toString()); + + Deduction3 compte2 = new Deduction3(); + compte2.crediter(); + compte2.crediter(); + compte2.crediter(); + compte2.crediter(); + compte2.crediter(); + compte2.crediter(); + compte2.crediter(); + compte2.crediter(); + compte2.crediter(); + System.out.println(compte2.toString()); + } +} \ No newline at end of file diff --git a/DEV2.1/CM1 (copy 1)/Exercice 2/Deduction2.java b/DEV2.1/CM1 (copy 1)/Exercice 2/Deduction2.java new file mode 100644 index 0000000..b2a413f --- /dev/null +++ b/DEV2.1/CM1 (copy 1)/Exercice 2/Deduction2.java @@ -0,0 +1,39 @@ +//MELIANI SAMY (TP1) +public class Deduction2{ + private int Limite, identifiant, Credit; + private int Accumulation; + public Deduction2(){ + Limite = 10; + Accumulation=0; + Credit = 0; + identifiant = 253782; + } + public int voir(){ + return Credit; + } + public void crediter(){ + if (Credit < 10){ + Credit += 1; + Accumulation += 1; + } + else{ + Credit = 1; + Accumulation += 1; + } + } + public void vider(){ + Credit = 0; + } + public String toString(){ + String str = ""; + str += "identifiant : " + identifiant + " "; + str += "Crédits restants : " + Credit + " "; + str += "Accumulation : " + Accumulation; + if(Credit == 10){ + str+= " PLAT OFFERT "; + } + return str; + + } + +} \ No newline at end of file diff --git a/DEV2.1/CM1 (copy 1)/Exercice 2/Deduction3.java b/DEV2.1/CM1 (copy 1)/Exercice 2/Deduction3.java new file mode 100644 index 0000000..c44aa83 --- /dev/null +++ b/DEV2.1/CM1 (copy 1)/Exercice 2/Deduction3.java @@ -0,0 +1,30 @@ +//MELIANI SAMY (TP1) +public class Deduction3{ + private int Limite, identifiant, Credit; + private int Accumulation; + public Deduction3(){ + Limite = 10; + Accumulation=0; + Credit = 10; + identifiant = 253782; + } + public int voir(){ + return Credit; + } + public void crediter(){ + Accumulation += 1; + } + public void vider(){ + Credit = 10; + } + public String toString(){ + String str = ""; + str += "YesCard USER "; + str += "identifiant : " + identifiant + " "; + str += "Crédits restants : " + Credit + " "; + str += "Accumulation : " + Accumulation; + str+= " PLAT OFFERT "; + return str; + } + +} \ No newline at end of file diff --git a/DEV2.1/CM1 (copy 1)/Exercice1/Decapite.class b/DEV2.1/CM1 (copy 1)/Exercice1/Decapite.class new file mode 100644 index 0000000..431eecd Binary files /dev/null and b/DEV2.1/CM1 (copy 1)/Exercice1/Decapite.class differ diff --git a/DEV2.1/CM1 (copy 1)/Exercice1/Decapite.java b/DEV2.1/CM1 (copy 1)/Exercice1/Decapite.java new file mode 100644 index 0000000..0d1aa10 --- /dev/null +++ b/DEV2.1/CM1 (copy 1)/Exercice1/Decapite.java @@ -0,0 +1,14 @@ +import java.awt.*; +//MELIANI SAMY (TP1) + +public class Decapite{ + public static void main(String[] args) { + boolean ihl1= GraphicsEnvironment.isHeadless(); + + GraphicsEnvironment ihl2 = new GraphicsEnvironment(); + boolean yes = ihl2.isHeadlessInstance(); + if(ihl1){ + System.out.println("oui"); + } + } +} \ No newline at end of file diff --git a/DEV2.1/CM1 (copy 1)/Exercice3/Directions.class b/DEV2.1/CM1 (copy 1)/Exercice3/Directions.class new file mode 100644 index 0000000..4e47b97 Binary files /dev/null and b/DEV2.1/CM1 (copy 1)/Exercice3/Directions.class differ diff --git a/DEV2.1/CM1 (copy 1)/Exercice3/Directions.java b/DEV2.1/CM1 (copy 1)/Exercice3/Directions.java new file mode 100644 index 0000000..64de55b --- /dev/null +++ b/DEV2.1/CM1 (copy 1)/Exercice3/Directions.java @@ -0,0 +1,29 @@ +//MELIANI SAMY (TP1) + +import javax.swing.*; +import java.awt.*; +public class Directions { + public static void main(String[] args) { + // un objet pour servir de fenetre + JFrame fenetre = new JFrame(); + // on configure la fenetre + fenetre.setSize(800, 800); + fenetre.setLocation(0, 0); + fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + GridLayout layout = new GridLayout(2, 2); + + + fenetre.setLayout(layout); + fenetre.add(new Button("◤")); + fenetre.add(new Button("◥")); + fenetre.add(new Button("◣")); + fenetre.add(new Button("◢")); + layout.setHgap(500); + layout.setVgap(500); + layout.setAlignment(100); + fenetre.setVisible(true); +} +} + + diff --git a/DEV2.1/CM1 (copy 1)/Exercice4/Debut.java b/DEV2.1/CM1 (copy 1)/Exercice4/Debut.java new file mode 100644 index 0000000..268d7a5 --- /dev/null +++ b/DEV2.1/CM1 (copy 1)/Exercice4/Debut.java @@ -0,0 +1,18 @@ +//MELIANI SAMY (TP1) +import java.awt.*; +import javax.swing.*; +import java.awt.event.*; + +public class Debut { + public static void main(String[] args) { + JFrame fenetre = new JFrame(""); + fenetre.setSize(650,650); + fenetre.setLocation(0, 0); + fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + Debut2 appel1 = new Debut2(); + Debut3 appel2 = new Debut3(appel1); + fenetre.addMouseListener(appel2); + fenetre.add(appel1); + fenetre.setVisible(true); + } +} diff --git a/DEV2.1/CM1 (copy 1)/Exercice4/Debut2.java b/DEV2.1/CM1 (copy 1)/Exercice4/Debut2.java new file mode 100644 index 0000000..c9a2276 --- /dev/null +++ b/DEV2.1/CM1 (copy 1)/Exercice4/Debut2.java @@ -0,0 +1,30 @@ +//MELIANI SAMY (TP1) +import java.awt.Color; +import java.awt.Graphics; +import javax.swing.JComponent; + +public class Debut2 extends JComponent { + private int rayon; + public Debut2(){ + super(); + rayon = 60; + } + + public void getrayon(int radius){ + this.rayon=radius; + this.repaint(); + } + + @Override + public void paintComponent(Graphics pinceau){ + Graphics secondPinceau=pinceau.create(); + if(this.isOpaque()){ + secondPinceau.setColor(this.getBackground()); + secondPinceau.fillRect(0, 0, this.getWidth(), this.getHeight()); + } + secondPinceau.setColor(new Color(115,194,251)); + secondPinceau.fillRect(0,0,this.getWidth(),this.getHeight()); + secondPinceau.setColor(Color.YELLOW); + secondPinceau.fillOval((this.getWidth()/2)-(this.rayon/2), (this.getHeight())-(this.rayon/2), this.rayon, this.rayon); + } +} diff --git a/DEV2.1/CM1 (copy 1)/Exercice4/Debut3.java b/DEV2.1/CM1 (copy 1)/Exercice4/Debut3.java new file mode 100644 index 0000000..f427d2a --- /dev/null +++ b/DEV2.1/CM1 (copy 1)/Exercice4/Debut3.java @@ -0,0 +1,23 @@ +//MELIANI SAMY (TP1) +import java.awt.*; +import javax.swing.*; +import java.awt.event.*; + +public class Debut3 implements MouseListener{ + private int rayon; + private Debut2 ref; + public Debut3(Debut2 appel){ + super(); + this.rayon=60; + this.ref=appel; + } + public void mouseEntered(MouseEvent evenement){} + public void mousePressed(MouseEvent evenement){} + public void mouseReleased(MouseEvent evenement){} + public void mouseExited(MouseEvent evenement){} + public void mouseClicked(MouseEvent evenement){ + this.rayon+=20; + ref.getrayon(this.rayon); + } + + } \ No newline at end of file diff --git a/DEV2.1/CM1/Exercice 2/Deduction.java b/DEV2.1/CM1/Exercice 2/Deduction.java new file mode 100644 index 0000000..9dbd78b --- /dev/null +++ b/DEV2.1/CM1/Exercice 2/Deduction.java @@ -0,0 +1,36 @@ +//MELIANI SAMY (TP1) +public class Deduction{ + public static void main(String[] args) { + Deduction2 compte = new Deduction2(); + compte.voir(); + compte.crediter(); + compte.crediter(); + compte.crediter(); + compte.crediter(); + compte.crediter(); + compte.vider(); + compte.crediter(); + compte.crediter(); + compte.crediter(); + compte.crediter(); + compte.crediter(); + compte.crediter(); + compte.crediter(); + compte.crediter(); + compte.crediter(); + compte.crediter(); + System.out.println(compte.toString()); + + Deduction3 compte2 = new Deduction3(); + compte2.crediter(); + compte2.crediter(); + compte2.crediter(); + compte2.crediter(); + compte2.crediter(); + compte2.crediter(); + compte2.crediter(); + compte2.crediter(); + compte2.crediter(); + System.out.println(compte2.toString()); + } +} \ No newline at end of file diff --git a/DEV2.1/CM1/Exercice 2/Deduction2.java b/DEV2.1/CM1/Exercice 2/Deduction2.java new file mode 100644 index 0000000..b2a413f --- /dev/null +++ b/DEV2.1/CM1/Exercice 2/Deduction2.java @@ -0,0 +1,39 @@ +//MELIANI SAMY (TP1) +public class Deduction2{ + private int Limite, identifiant, Credit; + private int Accumulation; + public Deduction2(){ + Limite = 10; + Accumulation=0; + Credit = 0; + identifiant = 253782; + } + public int voir(){ + return Credit; + } + public void crediter(){ + if (Credit < 10){ + Credit += 1; + Accumulation += 1; + } + else{ + Credit = 1; + Accumulation += 1; + } + } + public void vider(){ + Credit = 0; + } + public String toString(){ + String str = ""; + str += "identifiant : " + identifiant + " "; + str += "Crédits restants : " + Credit + " "; + str += "Accumulation : " + Accumulation; + if(Credit == 10){ + str+= " PLAT OFFERT "; + } + return str; + + } + +} \ No newline at end of file diff --git a/DEV2.1/CM1/Exercice 2/Deduction3.java b/DEV2.1/CM1/Exercice 2/Deduction3.java new file mode 100644 index 0000000..c44aa83 --- /dev/null +++ b/DEV2.1/CM1/Exercice 2/Deduction3.java @@ -0,0 +1,30 @@ +//MELIANI SAMY (TP1) +public class Deduction3{ + private int Limite, identifiant, Credit; + private int Accumulation; + public Deduction3(){ + Limite = 10; + Accumulation=0; + Credit = 10; + identifiant = 253782; + } + public int voir(){ + return Credit; + } + public void crediter(){ + Accumulation += 1; + } + public void vider(){ + Credit = 10; + } + public String toString(){ + String str = ""; + str += "YesCard USER "; + str += "identifiant : " + identifiant + " "; + str += "Crédits restants : " + Credit + " "; + str += "Accumulation : " + Accumulation; + str+= " PLAT OFFERT "; + return str; + } + +} \ No newline at end of file diff --git a/DEV2.1/CM1/Exercice1/Decapite.java b/DEV2.1/CM1/Exercice1/Decapite.java new file mode 100644 index 0000000..0d1aa10 --- /dev/null +++ b/DEV2.1/CM1/Exercice1/Decapite.java @@ -0,0 +1,14 @@ +import java.awt.*; +//MELIANI SAMY (TP1) + +public class Decapite{ + public static void main(String[] args) { + boolean ihl1= GraphicsEnvironment.isHeadless(); + + GraphicsEnvironment ihl2 = new GraphicsEnvironment(); + boolean yes = ihl2.isHeadlessInstance(); + if(ihl1){ + System.out.println("oui"); + } + } +} \ No newline at end of file diff --git a/DEV2.1/CM1/Exercice3/Direction.java b/DEV2.1/CM1/Exercice3/Direction.java new file mode 100644 index 0000000..5fa7cd2 --- /dev/null +++ b/DEV2.1/CM1/Exercice3/Direction.java @@ -0,0 +1,51 @@ +import java.awt.GridLayout; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JPanel; + +public class Direction extends JFrame{ + + GridLayout grid = new GridLayout(2, 2); + + public Direction(){ + grid.setHgap(350); +grid.setVgap(350); + JFrame frame = new JFrame(); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + frame.setSize(1900,900); + frame.setVisible(true); + JPanel panel = new JPanel(); + frame.setContentPane(panel); + panel.setLayout(grid); + + + +JButton btn1 = new JButton("◤"); +btn1.setSize(20,50); + + panel.add(btn1); +JButton btn2 = new JButton("◥"); + panel.add(btn2); +JButton btn3 = new JButton("◣"); + panel.add(btn3); +JButton btn4 = new JButton("◢"); + panel.add(btn4); + + + + } + + + + + public static void main(String[] args) { + new Direction(); + } +} + + + + + + + diff --git a/DEV2.1/CM1/Exercice3/Directions.java b/DEV2.1/CM1/Exercice3/Directions.java new file mode 100644 index 0000000..64de55b --- /dev/null +++ b/DEV2.1/CM1/Exercice3/Directions.java @@ -0,0 +1,29 @@ +//MELIANI SAMY (TP1) + +import javax.swing.*; +import java.awt.*; +public class Directions { + public static void main(String[] args) { + // un objet pour servir de fenetre + JFrame fenetre = new JFrame(); + // on configure la fenetre + fenetre.setSize(800, 800); + fenetre.setLocation(0, 0); + fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + GridLayout layout = new GridLayout(2, 2); + + + fenetre.setLayout(layout); + fenetre.add(new Button("◤")); + fenetre.add(new Button("◥")); + fenetre.add(new Button("◣")); + fenetre.add(new Button("◢")); + layout.setHgap(500); + layout.setVgap(500); + layout.setAlignment(100); + fenetre.setVisible(true); +} +} + + diff --git a/DEV2.1/CM1/Exercice4/Debut.java b/DEV2.1/CM1/Exercice4/Debut.java new file mode 100644 index 0000000..268d7a5 --- /dev/null +++ b/DEV2.1/CM1/Exercice4/Debut.java @@ -0,0 +1,18 @@ +//MELIANI SAMY (TP1) +import java.awt.*; +import javax.swing.*; +import java.awt.event.*; + +public class Debut { + public static void main(String[] args) { + JFrame fenetre = new JFrame(""); + fenetre.setSize(650,650); + fenetre.setLocation(0, 0); + fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + Debut2 appel1 = new Debut2(); + Debut3 appel2 = new Debut3(appel1); + fenetre.addMouseListener(appel2); + fenetre.add(appel1); + fenetre.setVisible(true); + } +} diff --git a/DEV2.1/CM1/Exercice4/Debut2.java b/DEV2.1/CM1/Exercice4/Debut2.java new file mode 100644 index 0000000..c9a2276 --- /dev/null +++ b/DEV2.1/CM1/Exercice4/Debut2.java @@ -0,0 +1,30 @@ +//MELIANI SAMY (TP1) +import java.awt.Color; +import java.awt.Graphics; +import javax.swing.JComponent; + +public class Debut2 extends JComponent { + private int rayon; + public Debut2(){ + super(); + rayon = 60; + } + + public void getrayon(int radius){ + this.rayon=radius; + this.repaint(); + } + + @Override + public void paintComponent(Graphics pinceau){ + Graphics secondPinceau=pinceau.create(); + if(this.isOpaque()){ + secondPinceau.setColor(this.getBackground()); + secondPinceau.fillRect(0, 0, this.getWidth(), this.getHeight()); + } + secondPinceau.setColor(new Color(115,194,251)); + secondPinceau.fillRect(0,0,this.getWidth(),this.getHeight()); + secondPinceau.setColor(Color.YELLOW); + secondPinceau.fillOval((this.getWidth()/2)-(this.rayon/2), (this.getHeight())-(this.rayon/2), this.rayon, this.rayon); + } +} diff --git a/DEV2.1/CM1/Exercice4/Debut3.java b/DEV2.1/CM1/Exercice4/Debut3.java new file mode 100644 index 0000000..f427d2a --- /dev/null +++ b/DEV2.1/CM1/Exercice4/Debut3.java @@ -0,0 +1,23 @@ +//MELIANI SAMY (TP1) +import java.awt.*; +import javax.swing.*; +import java.awt.event.*; + +public class Debut3 implements MouseListener{ + private int rayon; + private Debut2 ref; + public Debut3(Debut2 appel){ + super(); + this.rayon=60; + this.ref=appel; + } + public void mouseEntered(MouseEvent evenement){} + public void mousePressed(MouseEvent evenement){} + public void mouseReleased(MouseEvent evenement){} + public void mouseExited(MouseEvent evenement){} + public void mouseClicked(MouseEvent evenement){ + this.rayon+=20; + ref.getrayon(this.rayon); + } + + } \ No newline at end of file diff --git a/DEV2.1/CTRLBLANC/Exo1/Aléatoire b/DEV2.1/CTRLBLANC/Exo1/Aléatoire new file mode 100644 index 0000000..44c4d98 --- /dev/null +++ b/DEV2.1/CTRLBLANC/Exo1/Aléatoire @@ -0,0 +1,3 @@ +public class Aléatoire{ + +} \ No newline at end of file diff --git a/DEV2.1/CTRLBLANC/Exo1/Aléatoire.class b/DEV2.1/CTRLBLANC/Exo1/Aléatoire.class new file mode 100644 index 0000000..00e3ad6 Binary files /dev/null and b/DEV2.1/CTRLBLANC/Exo1/Aléatoire.class differ diff --git a/DEV2.1/CTRLBLANC/Exo1/Aléatoire.java b/DEV2.1/CTRLBLANC/Exo1/Aléatoire.java new file mode 100644 index 0000000..1f2f86b --- /dev/null +++ b/DEV2.1/CTRLBLANC/Exo1/Aléatoire.java @@ -0,0 +1,12 @@ +import java.lang.Math; +import java.util.Random; + +public class Aléatoire{ + public static void main(String[] args) { + double nb1; + nb1 = Math.random(); + Random nb2 = new Random(); + System.out.println("random propose : "+ nb1); + System.out.println("nextDouble propose : "+ nb2.nextDouble()); + } +} \ No newline at end of file diff --git a/DEV2.1/CTRLBLANC/Exo2/Grille.java b/DEV2.1/CTRLBLANC/Exo2/Grille.java new file mode 100644 index 0000000..939b397 --- /dev/null +++ b/DEV2.1/CTRLBLANC/Exo2/Grille.java @@ -0,0 +1,52 @@ +//HORVILLE Ewen Groupe N°4 + +public class Grille { + private short[][] Cases = new short[7][6]; + private int joueurActuel; + + public Grille() { + joueurActuel = 0; + } + + public void jouer(int colonne) { + if (colonne < 1 && colonne > 7) { + System.out.println("N° de colonne invalide !"); + return; + } + + boolean placementValide = false; + for (int i = 5; i >= 0; i--) { + if (Cases[colonne-1][i] == 0) { + Cases[colonne-1][i] = (short)(joueurActuel+1); + joueurActuel = (joueurActuel + 1) % 2; + placementValide = true; + break; + } + } + + if (!placementValide) { + System.out.println("Colonne n°" + colonne + " pleine !"); + } + } + + @Override + public String toString() { + String str = ""; + + for (int x = 0; x < 6; x++) { + for (int y = 0; y < 7; y++) { + str += "│"; + + if (Cases[y][x] == 0) str += " "; + else if (Cases[y][x] == 1) str += "○"; + else if (Cases[y][x] == 2) str += "●"; + } + + str += "│\n"; + } + + str += "┴─┴─┴─┴─┴─┴─┴─┴"; + + return str; + } +} \ No newline at end of file diff --git a/DEV2.1/CTRLBLANC/Exo2/NOLAN EXO/MaGrille.java b/DEV2.1/CTRLBLANC/Exo2/NOLAN EXO/MaGrille.java new file mode 100644 index 0000000..e5c5cde --- /dev/null +++ b/DEV2.1/CTRLBLANC/Exo2/NOLAN EXO/MaGrille.java @@ -0,0 +1,48 @@ +public class MaGrille { + private String[][] Grille; + private int i, j, ligne, colonne, tour = 0; + + public MaGrille(int li, int col) { + this.ligne = li; + this.colonne = col; + } + + public MaGrille Gvide(int l, int c) { + MaGrille newGrille = new MaGrille(this.ligne, this.colonne); + String[][] grille = new String[newGrille.ligne][newGrille.colonne]; + for(i=0;i0;i--) { + if (Grille[i][colonne-1] == " ") { + if (tour%2 == 0) { + this.Grille[i][colonne-1] = "o"; + tour++; + } + else { + this.Grille[i][colonne-1] = "x"; + tour++; + } + } + } + } +} \ No newline at end of file diff --git a/DEV2.1/CTRLBLANC/Exo2/NOLAN EXO/Puissance.java b/DEV2.1/CTRLBLANC/Exo2/NOLAN EXO/Puissance.java new file mode 100644 index 0000000..b50426d --- /dev/null +++ b/DEV2.1/CTRLBLANC/Exo2/NOLAN EXO/Puissance.java @@ -0,0 +1,15 @@ +public class Puissance { + public static void main(String[] args) { + MaGrille grille = new MaGrille(6, 7); + + grille.Gvide(6, 7); + grille.Jouer(3); + grille.Jouer(4); + grille.Jouer(4); + grille.Jouer(6); + grille.Jouer(4); + grille.Jouer(6); + + System.out.println(grille.toString()); + } +} \ No newline at end of file diff --git a/DEV2.1/CTRLBLANC/Exo2/Puissance.java b/DEV2.1/CTRLBLANC/Exo2/Puissance.java new file mode 100644 index 0000000..05d7816 --- /dev/null +++ b/DEV2.1/CTRLBLANC/Exo2/Puissance.java @@ -0,0 +1,15 @@ +//HORVILLE Ewen Groupe N°4 + +public class Puissance { + public static void main(String[] args) { + Grille g = new Grille(); + + g.jouer(3); + g.jouer(4); + g.jouer(4); + g.jouer(6); + g.jouer(4); + g.jouer(6); + System.out.println(g); + } +} \ No newline at end of file diff --git a/DEV2.1/CTRLBLANC/Exo3/Untitled.mdj b/DEV2.1/CTRLBLANC/Exo3/Untitled.mdj new file mode 100644 index 0000000..7c03f06 --- /dev/null +++ b/DEV2.1/CTRLBLANC/Exo3/Untitled.mdj @@ -0,0 +1,292 @@ +{ + "_type": "Project", + "_id": "AAAAAAFF+h6SjaM2Hec=", + "name": "Untitled", + "ownedElements": [ + { + "_type": "UMLModel", + "_id": "AAAAAAFF+qBWK6M3Z8Y=", + "_parent": { + "$ref": "AAAAAAFF+h6SjaM2Hec=" + }, + "name": "Model", + "ownedElements": [ + { + "_type": "UMLClassDiagram", + "_id": "AAAAAAFF+qBtyKM79qY=", + "_parent": { + "$ref": "AAAAAAFF+qBWK6M3Z8Y=" + }, + "name": "Main", + "defaultDiagram": true, + "ownedViews": [ + { + "_type": "UMLClassView", + "_id": "AAAAAAGHKCIlSPo2MVY=", + "_parent": { + "$ref": "AAAAAAFF+qBtyKM79qY=" + }, + "model": { + "$ref": "AAAAAAGHKCIlRfo0xPg=" + }, + "subViews": [ + { + "_type": "UMLNameCompartmentView", + "_id": "AAAAAAGHKCIlSfo3DSc=", + "_parent": { + "$ref": "AAAAAAGHKCIlSPo2MVY=" + }, + "model": { + "$ref": "AAAAAAGHKCIlRfo0xPg=" + }, + "subViews": [ + { + "_type": "LabelView", + "_id": "AAAAAAGHKCIlSfo48Ks=", + "_parent": { + "$ref": "AAAAAAGHKCIlSfo3DSc=" + }, + "visible": false, + "font": "Arial;13;0", + "top": -16, + "height": 13 + }, + { + "_type": "LabelView", + "_id": "AAAAAAGHKCIlSvo5dwo=", + "_parent": { + "$ref": "AAAAAAGHKCIlSfo3DSc=" + }, + "font": "Arial;13;1", + "left": 437, + "top": 255, + "width": 230, + "height": 13, + "text": "Grille" + }, + { + "_type": "LabelView", + "_id": "AAAAAAGHKCIlSvo6CzE=", + "_parent": { + "$ref": "AAAAAAGHKCIlSfo3DSc=" + }, + "visible": false, + "font": "Arial;13;0", + "top": -16, + "width": 73.67724609375, + "height": 13, + "text": "(from Model)" + }, + { + "_type": "LabelView", + "_id": "AAAAAAGHKCIlSvo7yPk=", + "_parent": { + "$ref": "AAAAAAGHKCIlSfo3DSc=" + }, + "visible": false, + "font": "Arial;13;0", + "top": -16, + "height": 13, + "horizontalAlignment": 1 + } + ], + "font": "Arial;13;0", + "left": 432, + "top": 248, + "width": 240, + "height": 25, + "stereotypeLabel": { + "$ref": "AAAAAAGHKCIlSfo48Ks=" + }, + "nameLabel": { + "$ref": "AAAAAAGHKCIlSvo5dwo=" + }, + "namespaceLabel": { + "$ref": "AAAAAAGHKCIlSvo6CzE=" + }, + "propertyLabel": { + "$ref": "AAAAAAGHKCIlSvo7yPk=" + } + }, + { + "_type": "UMLAttributeCompartmentView", + "_id": "AAAAAAGHKCIlSvo8Uko=", + "_parent": { + "$ref": "AAAAAAGHKCIlSPo2MVY=" + }, + "model": { + "$ref": "AAAAAAGHKCIlRfo0xPg=" + }, + "subViews": [ + { + "_type": "UMLAttributeView", + "_id": "AAAAAAGHKCJMvPpheJY=", + "_parent": { + "$ref": "AAAAAAGHKCIlSvo8Uko=" + }, + "model": { + "$ref": "AAAAAAGHKCJMuPpekSE=" + }, + "font": "Arial;13;0", + "left": 437, + "top": 278, + "width": 230, + "height": 13, + "text": "+Attribute1", + "horizontalAlignment": 0 + }, + { + "_type": "UMLAttributeView", + "_id": "AAAAAAGHKCMAjvpq7Tw=", + "_parent": { + "$ref": "AAAAAAGHKCIlSvo8Uko=" + }, + "model": { + "$ref": "AAAAAAGHKCMAffpn4Pg=" + }, + "font": "Arial;13;0", + "left": 437, + "top": 293, + "width": 230, + "height": 13, + "text": "+Attribute2", + "horizontalAlignment": 0 + } + ], + "font": "Arial;13;0", + "left": 432, + "top": 273, + "width": 240, + "height": 38 + }, + { + "_type": "UMLOperationCompartmentView", + "_id": "AAAAAAGHKCIlS/o9i6E=", + "_parent": { + "$ref": "AAAAAAGHKCIlSPo2MVY=" + }, + "model": { + "$ref": "AAAAAAGHKCIlRfo0xPg=" + }, + "subViews": [ + { + "_type": "UMLOperationView", + "_id": "AAAAAAGHKCObzvp6IIc=", + "_parent": { + "$ref": "AAAAAAGHKCIlS/o9i6E=" + }, + "model": { + "$ref": "AAAAAAGHKCObvPp3kUs=" + }, + "font": "Arial;13;0", + "left": 437, + "top": 316, + "width": 230, + "height": 13, + "text": "+Operation1()", + "horizontalAlignment": 0 + } + ], + "font": "Arial;13;0", + "left": 432, + "top": 311, + "width": 240, + "height": 23 + }, + { + "_type": "UMLReceptionCompartmentView", + "_id": "AAAAAAGHKCIlS/o+pRA=", + "_parent": { + "$ref": "AAAAAAGHKCIlSPo2MVY=" + }, + "model": { + "$ref": "AAAAAAGHKCIlRfo0xPg=" + }, + "visible": false, + "font": "Arial;13;0", + "top": -8, + "width": 10, + "height": 10 + }, + { + "_type": "UMLTemplateParameterCompartmentView", + "_id": "AAAAAAGHKCIlTPo/W/0=", + "_parent": { + "$ref": "AAAAAAGHKCIlSPo2MVY=" + }, + "model": { + "$ref": "AAAAAAGHKCIlRfo0xPg=" + }, + "visible": false, + "font": "Arial;13;0", + "top": -8, + "width": 10, + "height": 10 + } + ], + "font": "Arial;13;0", + "containerChangeable": true, + "left": 432, + "top": 248, + "width": 240, + "height": 216, + "nameCompartment": { + "$ref": "AAAAAAGHKCIlSfo3DSc=" + }, + "attributeCompartment": { + "$ref": "AAAAAAGHKCIlSvo8Uko=" + }, + "operationCompartment": { + "$ref": "AAAAAAGHKCIlS/o9i6E=" + }, + "receptionCompartment": { + "$ref": "AAAAAAGHKCIlS/o+pRA=" + }, + "templateParameterCompartment": { + "$ref": "AAAAAAGHKCIlTPo/W/0=" + } + } + ] + }, + { + "_type": "UMLClass", + "_id": "AAAAAAGHKCIlRfo0xPg=", + "_parent": { + "$ref": "AAAAAAFF+qBWK6M3Z8Y=" + }, + "name": "Grille", + "attributes": [ + { + "_type": "UMLAttribute", + "_id": "AAAAAAGHKCJMuPpekSE=", + "_parent": { + "$ref": "AAAAAAGHKCIlRfo0xPg=" + }, + "name": "Attribute1", + "type": "" + }, + { + "_type": "UMLAttribute", + "_id": "AAAAAAGHKCMAffpn4Pg=", + "_parent": { + "$ref": "AAAAAAGHKCIlRfo0xPg=" + }, + "name": "Attribute2", + "type": "" + } + ], + "operations": [ + { + "_type": "UMLOperation", + "_id": "AAAAAAGHKCObvPp3kUs=", + "_parent": { + "$ref": "AAAAAAGHKCIlRfo0xPg=" + }, + "name": "Operation1" + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/DEV2.1/CTRLBLANC/Exo4/CrocsCars.class b/DEV2.1/CTRLBLANC/Exo4/CrocsCars.class new file mode 100644 index 0000000..476f474 Binary files /dev/null and b/DEV2.1/CTRLBLANC/Exo4/CrocsCars.class differ diff --git a/DEV2.1/CTRLBLANC/Exo4/CrocsCars.java b/DEV2.1/CTRLBLANC/Exo4/CrocsCars.java new file mode 100644 index 0000000..a413145 --- /dev/null +++ b/DEV2.1/CTRLBLANC/Exo4/CrocsCars.java @@ -0,0 +1,43 @@ +import javax.swing.*; +import java.awt.*; + +public class CrocsCars extends JComponent{ + + private Image pingouin; + + public CrocsCars(){ + super(); + this.pingouin = Toolkit.getDefaultToolkit().getImage("tuile.png"); + } + @Override + protected void paintComponent(Graphics pinceau){ + Graphics secondPinceau = pinceau.create(); + if (this.isOpaque()){ + secondPinceau.setColor(this.getBackground()); + secondPinceau.fillRect(0, 0, this.getWidth(), this.getHeight()); + } + secondPinceau.drawImage(this.pingouin, 0, 0,this); + secondPinceau.drawImage(this.pingouin, 512, 0,this); + secondPinceau.drawImage(this.pingouin, 0, 512,this); + secondPinceau.drawImage(this.pingouin, 512, 512,this); + + if(this.getHeight() >= 1024){ + secondPinceau.drawImage(this.pingouin, 0, 1024,this); + secondPinceau.drawImage(this.pingouin, 512, 1024,this); + if(this.getWidth() >= 1024){ + secondPinceau.drawImage(this.pingouin, 1024, 1024,this); + + } + if(this.getWidth() >= 1024){ + secondPinceau.drawImage(this.pingouin, 1024, 0,this); + secondPinceau.drawImage(this.pingouin, 1024, 512,this); + if(this.getHeight() >= 1024){ + secondPinceau.drawImage(this.pingouin, 1024, 1024,this); + } + } + + } + + } + +} \ No newline at end of file diff --git a/DEV2.1/CTRLBLANC/Exo4/Tuile.class b/DEV2.1/CTRLBLANC/Exo4/Tuile.class new file mode 100644 index 0000000..1473d89 Binary files /dev/null and b/DEV2.1/CTRLBLANC/Exo4/Tuile.class differ diff --git a/DEV2.1/CTRLBLANC/Exo4/Tuile.java b/DEV2.1/CTRLBLANC/Exo4/Tuile.java new file mode 100644 index 0000000..3b4f223 --- /dev/null +++ b/DEV2.1/CTRLBLANC/Exo4/Tuile.java @@ -0,0 +1,14 @@ +import javax.swing.*; +import java.awt.*; + +public class Tuile{ + public static void main(String[] args) { + JFrame fenetre = new JFrame(); + fenetre.setSize(1920,1080); + fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + CrocsCars cadre = new CrocsCars(); + fenetre.add(cadre); + fenetre.setVisible(true); + + } +} \ No newline at end of file diff --git a/DEV2.1/CTRLBLANC/Exo4/lexodugayla/TileBackground.java b/DEV2.1/CTRLBLANC/Exo4/lexodugayla/TileBackground.java new file mode 100644 index 0000000..1fa0322 --- /dev/null +++ b/DEV2.1/CTRLBLANC/Exo4/lexodugayla/TileBackground.java @@ -0,0 +1,29 @@ +import java.awt.; +import javax.swing.; + +public class TileBackground extends JComponent { + private Image tile; + private int tileScale; + + public TileBackground(int tileScale, String imagePath) { + super(); + this.tile = Toolkit.getDefaultToolkit().getImage(imagePath); + this.tileScale = tileScale; + } + + @Override + protected void paintComponent(Graphics brush) { + Graphics newBrush = brush.create(); + if (this.isOpaque()) { + newBrush.setColor(this.getBackground()); + newBrush.fillRect(0, 0, this.getWidth(), this.getHeight()); + } + int horizontalReps = this.getWidth() / this.tileScale + 1; + int verticalReps = this.getHeight() / this.tileScale + 1; + for (int x = 0; x < horizontalReps; x++) { + for (int y = 0; y < verticalReps; y++) { + newBrush.drawImage(this.tile, x * tileScale, y * tileScale, tileScale, tileScale, this); + } + } + } +} \ No newline at end of file diff --git a/DEV2.1/CTRLBLANC/Exo4/lexodugayla/Tuile2.java b/DEV2.1/CTRLBLANC/Exo4/lexodugayla/Tuile2.java new file mode 100644 index 0000000..6b93f57 --- /dev/null +++ b/DEV2.1/CTRLBLANC/Exo4/lexodugayla/Tuile2.java @@ -0,0 +1,13 @@ +import javax.swing.*; + +public class Tuile2 { + public static void main(String[] args) { + JFrame f = new JFrame("Tuile"); + f.setLocation(150, 150); + f.setSize(500, 500); + f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + f.setVisible(true); + TileBackground tb = new TileBackground(150, "./tuile.jpg"); + f.add(tb); + } +} diff --git a/DEV2.1/CTRLBLANC/Exo4/tuile.jpg b/DEV2.1/CTRLBLANC/Exo4/tuile.jpg new file mode 100644 index 0000000..55612e6 Binary files /dev/null and b/DEV2.1/CTRLBLANC/Exo4/tuile.jpg differ diff --git a/DEV2.1/CTRLBLANC/Exo4/tuile.png b/DEV2.1/CTRLBLANC/Exo4/tuile.png new file mode 100644 index 0000000..0f4aca0 Binary files /dev/null and b/DEV2.1/CTRLBLANC/Exo4/tuile.png differ diff --git a/DEV2.1/CTRLBLANC/Exo5/Fermeture.class b/DEV2.1/CTRLBLANC/Exo5/Fermeture.class new file mode 100644 index 0000000..e88501b Binary files /dev/null and b/DEV2.1/CTRLBLANC/Exo5/Fermeture.class differ diff --git a/DEV2.1/CTRLBLANC/Exo5/Fermeture.java b/DEV2.1/CTRLBLANC/Exo5/Fermeture.java new file mode 100644 index 0000000..855f582 --- /dev/null +++ b/DEV2.1/CTRLBLANC/Exo5/Fermeture.java @@ -0,0 +1,21 @@ +import java.awt.*; +import javax.swing.*; + + + +public class Fermeture{ + public static void main(String[] args) { + JFrame fenetre = new JFrame(); + fenetre.setSize(800, 800); + Oui yeet = new Oui(); + while(yeet.checkVrai()!= true){ + fenetre.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); + fenetre.setVisible(true); + + } + fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + fenetre.addWindowListener(yeet); + fenetre.setVisible(true); + + } +} diff --git a/DEV2.1/CTRLBLANC/Exo5/Oui.class b/DEV2.1/CTRLBLANC/Exo5/Oui.class new file mode 100644 index 0000000..c230140 Binary files /dev/null and b/DEV2.1/CTRLBLANC/Exo5/Oui.class differ diff --git a/DEV2.1/CTRLBLANC/Exo5/Oui.java b/DEV2.1/CTRLBLANC/Exo5/Oui.java new file mode 100644 index 0000000..e617f42 --- /dev/null +++ b/DEV2.1/CTRLBLANC/Exo5/Oui.java @@ -0,0 +1,28 @@ +import java.awt.event.*; +import javax.swing.*; + +public class Oui implements WindowListener{ + private int a; + public Oui(){ + super(); + this.a=0; + } + public void windowActivated(WindowEvent evenement){} // premier plan + public void windowClosed(WindowEvent evenement){} // après fermeture + public void windowClosing(WindowEvent evenement){} // avant fermeture + public void windowDeactivated(WindowEvent evenement){} // arrière-plan + public void windowDeiconified(WindowEvent evenement){} // restauration + public void windowOpened(WindowEvent evenement){} + public void windowIconified(WindowEvent e){ + this.a=1; + } + public boolean checkVrai(){ + if (this.a == 1){ + return true; + } + else{ + return false; + } + } + +} \ No newline at end of file diff --git a/DEV2.1/TP02/Contin.class b/DEV2.1/TP02/Contin.class new file mode 100644 index 0000000..14b5775 Binary files /dev/null and b/DEV2.1/TP02/Contin.class differ diff --git a/DEV2.1/TP02/Contin.java b/DEV2.1/TP02/Contin.java new file mode 100644 index 0000000..a1296cb --- /dev/null +++ b/DEV2.1/TP02/Contin.java @@ -0,0 +1,31 @@ +import javax.swing.*; +import java.awt.*; + +public class Contin { + public static void main(String[] args) { + // un objet pour servir de fenetre + JFrame fenetre = new JFrame(); + // on configure la fenetre + fenetre.setSize(900, 600); + fenetre.setLocation(0, 0); + fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + // un composant pour afficher du texte + JTextField etiquette = new JTextField("JE suis un texte oui je suis du texte !"); + // on configure l'etiquette + etiquette.setForeground(new Color(0,255,0)); + etiquette.setBackground(new Color(211,211,211)); + etiquette.setHorizontalAlignment(JTextField.CENTER); + fenetre.add(etiquette, BorderLayout.SOUTH); + + JTextArea champ = new JTextArea(); + champ.setLineWrap(true); + champ.setBackground(new Color(0,0,0)); + champ.setForeground(new Color(0,255,0)); + fenetre.add(champ, BorderLayout.CENTER); + + JScrollPane barre = new JScrollPane(champ); + barre.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); + fenetre.add(barre, BorderLayout.CENTER); + fenetre.setVisible(true); + } +} \ No newline at end of file diff --git a/DEV2.1/TP03/Choix.class b/DEV2.1/TP03/Choix.class new file mode 100644 index 0000000..5c15c87 Binary files /dev/null and b/DEV2.1/TP03/Choix.class differ diff --git a/DEV2.1/TP03/Choix.java b/DEV2.1/TP03/Choix.java index 9c40882..7de93da 100644 --- a/DEV2.1/TP03/Choix.java +++ b/DEV2.1/TP03/Choix.java @@ -1,8 +1,7 @@ -import javax.sql.rowset.serial.SerialArray; import javax.swing.*; import java.awt.*; -public class Choix { +public class Choix{ public static void main(String[] args) { // un objet pour servir de fenetre JFrame fenetre = new JFrame(); @@ -17,20 +16,25 @@ public class Choix { JRadioButton Serdaigle = new JRadioButton("Serdaigle"); Serdaigle.setHorizontalAlignment(JRadioButton.CENTER); - fenetre.add(Serdaigle, BorderLayout.CENTER); + fenetre.add(Serdaigle, BorderLayout.EAST); JRadioButton Serpentard = new JRadioButton("Serpentard"); Serpentard.setHorizontalAlignment(JRadioButton.CENTER); - fenetre.add(Serpentard, BorderLayout.SOUTH); + fenetre.add(Serpentard, BorderLayout.WEST); + + JRadioButton Poufsouffle = new JRadioButton("PoufsouffleEclaté"); + Poufsouffle.setHorizontalAlignment(JRadioButton.CENTER); + fenetre.add(Poufsouffle, BorderLayout.SOUTH); ButtonGroup Groupe = new ButtonGroup(); Groupe.add(Gryffondor); Groupe.add(Serdaigle); Groupe.add(Serpentard); + Groupe.add(Poufsouffle); - - + Dimension size = new Dimension(300,150); + fenetre.setMinimumSize(size); fenetre.setVisible(true); } } \ No newline at end of file diff --git a/DEV2.1/TP03/Damier.class b/DEV2.1/TP03/Damier.class new file mode 100644 index 0000000..ef11bf1 Binary files /dev/null and b/DEV2.1/TP03/Damier.class differ diff --git a/DEV2.1/TP03/Damier.java b/DEV2.1/TP03/Damier.java new file mode 100644 index 0000000..d0d20bc --- /dev/null +++ b/DEV2.1/TP03/Damier.java @@ -0,0 +1,33 @@ +import javax.swing.*; +import java.awt.*; + +public class Damier{ + public static void main(String[] args) { + // un objet pour servir de fenetre + JFrame fenetre = new JFrame("Damier"); + // on configure la fenetre + fenetre.setSize(500, 500); + fenetre.setLocation(0, 0); + fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + // on fait la grille + int ligne = Integer.parseInt(args[0]); + + GridLayout grille = new GridLayout(ligne,ligne); + + fenetre.setLayout(grille); + for(int i=0; i = 8){ + if(this.jour%2 == 0){ + this.jour +=1 + } + else{ + this.jour = 1; + } + + } + } + } + else{ + if (this.jour == 28){ + this.jour == 1; + } + else{ + this.jour +=1; + } + } + if(this.jour == 31){ + this.jour == 1; + } + if (this.jour ==1){ + if(this.mois !=12){ + this.mois+=1; + } + else{ + this.mois = 1; + this.annee +=1; + } + } + } + public String toString(){ + /*if(this.jour <10){ + return Integer.toString(this.annee) +"-" + Integer.toString(this.mois) + "-0" + Integer.toString(this.jour); + } + if(this.mois <10){ + return Integer.toString(this.annee) +"-0" + Integer.toString(this.mois) + "-" + Integer.toString(this.jour); + } + if(this.annee < 1000){ + return "0" + Integer.toString(this.annee) +"-" + Integer.toString(this.mois) + "-" + Integer.toString(this.jour); */ + return Integer.toString(this.annee) +"-" + Integer.toString(this.mois) + "-" + Integer.toString(this.jour); + } +} \ No newline at end of file diff --git a/DEV2.1/TP04/Compteur.class b/DEV2.1/TP04/Compteur.class new file mode 100644 index 0000000..d3949d3 Binary files /dev/null and b/DEV2.1/TP04/Compteur.class differ diff --git a/DEV2.1/TP04/Compteur.java b/DEV2.1/TP04/Compteur.java new file mode 100644 index 0000000..25e0282 --- /dev/null +++ b/DEV2.1/TP04/Compteur.java @@ -0,0 +1,15 @@ +public class Compteur { + // attribut + private int compte; + // méthode + public Compteur() { + this.compte = 0; + } + public void plusUn() { + this.compte++; + } + // autre méthode + public String toString() { + return Integer.toBinaryString(this.compte); + } + } \ No newline at end of file diff --git a/DEV2.1/TP04/Date.class b/DEV2.1/TP04/Date.class new file mode 100644 index 0000000..e1c81f5 Binary files /dev/null and b/DEV2.1/TP04/Date.class differ diff --git a/DEV2.1/TP04/Date.java b/DEV2.1/TP04/Date.java new file mode 100644 index 0000000..b4ab970 --- /dev/null +++ b/DEV2.1/TP04/Date.java @@ -0,0 +1,7 @@ +public class Date{ + public static void main(String[] args) { + Alligner d = new Alligner(); + d.toString(); + System.out.print(d); + } +} \ No newline at end of file diff --git a/DEV2.1/TP04/progression.class b/DEV2.1/TP04/progression.class new file mode 100644 index 0000000..e9ac298 Binary files /dev/null and b/DEV2.1/TP04/progression.class differ diff --git a/DEV2.1/TP04/progression.java b/DEV2.1/TP04/progression.java new file mode 100644 index 0000000..8ebf082 --- /dev/null +++ b/DEV2.1/TP04/progression.java @@ -0,0 +1,11 @@ +public class progression{ + public static void main(String[] args) { + Compteur c = new Compteur(); + for (int i=0; i<=9; i++){ + c.plusUn(); + if(i>=4){ + System.out.print(c + " "); + } + } + } +} \ No newline at end of file diff --git a/DEV2.1/TP05/Doc2.class b/DEV2.1/TP05/Doc2.class new file mode 100644 index 0000000..fba8dde Binary files /dev/null and b/DEV2.1/TP05/Doc2.class differ diff --git a/DEV2.1/TP05/Doc2.java b/DEV2.1/TP05/Doc2.java new file mode 100644 index 0000000..4214c01 --- /dev/null +++ b/DEV2.1/TP05/Doc2.java @@ -0,0 +1,16 @@ + +public class Doc2{ + public static void main(String[] args) { + String regroupe = ""; + for(int i=0; i0 && this.a>0){ + this.a--; + ce.getNombre(this.a); + } + } +} \ No newline at end of file diff --git a/DEV2.1/TP10/Exo1/Plantages.class b/DEV2.1/TP10/Exo1/Plantages.class new file mode 100644 index 0000000..a9b9dff Binary files /dev/null and b/DEV2.1/TP10/Exo1/Plantages.class differ diff --git a/DEV2.1/TP10/Exo1/Plantages.java b/DEV2.1/TP10/Exo1/Plantages.java new file mode 100644 index 0000000..3645d02 --- /dev/null +++ b/DEV2.1/TP10/Exo1/Plantages.java @@ -0,0 +1,13 @@ +public class Plantages{ + public static void main(String[] args){ + try { + int n = Integer.parseInt(args[0]); + System.out.println("En hexadécimal : " + Integer.toHexString(n)); + } catch(NumberFormatException e1) { + System.err.println('\"' + args[0] + "\" n'est pas un entier !"); + } catch(ArrayIndexOutOfBoundsException e2) { + System.err.println("Pas d'argument à convertir !"); + } +} + +} \ No newline at end of file diff --git a/DEV2.1/TP10/Exo1/Plantages2.class b/DEV2.1/TP10/Exo1/Plantages2.class new file mode 100644 index 0000000..066efa0 Binary files /dev/null and b/DEV2.1/TP10/Exo1/Plantages2.class differ diff --git a/DEV2.1/TP10/Exo1/Plantages2.java b/DEV2.1/TP10/Exo1/Plantages2.java new file mode 100644 index 0000000..60f3151 --- /dev/null +++ b/DEV2.1/TP10/Exo1/Plantages2.java @@ -0,0 +1,6 @@ +public class Plantages2{ + public static void main(String[] args){ + String oui = "heehee"; + System.out.println("En int : " + Integer.parseInt(oui)); +} +} \ No newline at end of file diff --git a/DEV2.1/TP10/Exo1/Plantages3.class b/DEV2.1/TP10/Exo1/Plantages3.class new file mode 100644 index 0000000..edb6cbd Binary files /dev/null and b/DEV2.1/TP10/Exo1/Plantages3.class differ diff --git a/DEV2.1/TP10/Exo1/Plantages3.java b/DEV2.1/TP10/Exo1/Plantages3.java new file mode 100644 index 0000000..a7fe875 --- /dev/null +++ b/DEV2.1/TP10/Exo1/Plantages3.java @@ -0,0 +1,6 @@ +public class Plantages3{ + public static void main(String[] args){ + int giorno = 8; + System.out.println(giorno/0); + } +} \ No newline at end of file diff --git a/DEV2.1/TP10/Exo1/Plantages4.class b/DEV2.1/TP10/Exo1/Plantages4.class new file mode 100644 index 0000000..af5951e Binary files /dev/null and b/DEV2.1/TP10/Exo1/Plantages4.class differ diff --git a/DEV2.1/TP10/Exo1/Plantages4.java b/DEV2.1/TP10/Exo1/Plantages4.java new file mode 100644 index 0000000..59151a1 --- /dev/null +++ b/DEV2.1/TP10/Exo1/Plantages4.java @@ -0,0 +1,7 @@ +public class Plantages4{ + public static void main(String[] args){ + String[] b = new String[10]; + b[1] = null; + System.out.println(b[1].length()); + } +} \ No newline at end of file diff --git a/DEV2.1/TP10/Exo1/Plantages5.class b/DEV2.1/TP10/Exo1/Plantages5.class new file mode 100644 index 0000000..8fb1c38 Binary files /dev/null and b/DEV2.1/TP10/Exo1/Plantages5.class differ diff --git a/DEV2.1/TP10/Exo1/Plantages5.java b/DEV2.1/TP10/Exo1/Plantages5.java new file mode 100644 index 0000000..0fd12e9 --- /dev/null +++ b/DEV2.1/TP10/Exo1/Plantages5.java @@ -0,0 +1,6 @@ +public class Plantages5 { +public static void main(String[] args) { +int ary[] = {4, 6, 2}; +System.out.println("Result: " + ary[3]); +} +} \ No newline at end of file diff --git a/DEV2.1/TP10/Exo2/Capture.class b/DEV2.1/TP10/Exo2/Capture.class new file mode 100644 index 0000000..f4cd21f Binary files /dev/null and b/DEV2.1/TP10/Exo2/Capture.class differ diff --git a/DEV2.1/TP10/Exo2/Capture.java b/DEV2.1/TP10/Exo2/Capture.java new file mode 100644 index 0000000..35e87ec --- /dev/null +++ b/DEV2.1/TP10/Exo2/Capture.java @@ -0,0 +1,14 @@ +public class Capture{ + public static void pignouf(){ + int giorno = 8; + giorno= giorno/0; + } + public static void main(String[] args){ + try{ + pignouf(); + } + catch(ArithmeticException e){ + System.err.println("Mec t'a pas le droit de diviser par 0 t'es un fou furieux jte report pd"); + } + } +} \ No newline at end of file diff --git a/DEV2.1/TP10/Exo3/Incomplet.java b/DEV2.1/TP10/Exo3/Incomplet.java new file mode 100644 index 0000000..2a591e4 --- /dev/null +++ b/DEV2.1/TP10/Exo3/Incomplet.java @@ -0,0 +1,6 @@ +public class Incomplet { + public static void main(String[] args) { + byte[] txt = {0x48, 0x65, 0x6C, 0x6C, 0x6F, 0x0D, 0x0A}; + System.out.write(txt); + } +} \ No newline at end of file diff --git a/DEV2.1/meliani_CM1.tar.gz b/DEV2.1/meliani_CM1.tar.gz new file mode 100644 index 0000000..3d3bb30 Binary files /dev/null and b/DEV2.1/meliani_CM1.tar.gz differ diff --git a/DEV2.1/tp4.txt b/DEV2.1/tp4.txt new file mode 100755 index 0000000..53441d6 --- /dev/null +++ b/DEV2.1/tp4.txt @@ -0,0 +1,21 @@ +insert into AEROPORT values('LFPG','CDG', 'PARIS', 'FRANCE'); +insert into AEROPORT values('LFPG','crocs', 'PARIS', 'FRANCE'); +insert into AEROPORT values('LFPO','ORLY', 'PARIS', 'FRANCE'); +insert into AEROPORT values('LFML','MRS', 'MARSEILLE', 'FRANCE'); +insert into AEROPORT values(null,'UI', 'MARSEILLE', 'FRANCE'); + +ORA-00001: violation de contrainte unique (MELIANI.SYS_C0083286) +ORA-01400: impossible d'insérer NULL dans ("MELIANI"."AEROPORT"."CODEAEROPORT") + +Exo2 +Create table ESCALE(numVol int, numEscale int, aeroportDepart varchar(15) references Aeroport, +aeroportArrivee varchar(15) references Aeroport, heureDepartPrevue int, minuteDepartPrevue int, heureArriveePrevue int, minuteArriveePrevue int, primary key(numVol, numEscale)); + +CREATE TABLE INSTANCE_ESCALE(numVol int, numEscale int, dateEscale date, nbreSieges int, idAvion int references Avion, dateDepartEffectue date, dateArriveeEffectue date,idEquipe int, + primary key(numVol, numEscale, dateEscale), foreign key(numVol, numEscale)references ESCALE); + +ALTER TABLE INSTANCE_ESCALE ADD FOREIGN KEY(idEquipe) REFERENCES Equipage; + +CREATE TABLE Equipage(numVol int, numEscale int, dateEscale date, idEquipe int primary key, idPilote int, idCoPilote int, idChefCabine int, foreign key(numVol,numEscale,dateEscale) references INSTANCE_ESCALE); + +CREATE TABLE HOTESSE_EQUIPAGE(idEquipe int references Equipage references Personnel, idPersonne int, primary key(idEquipe,idPersonne)); \ No newline at end of file diff --git a/DEV2.1/tp5.txt b/DEV2.1/tp5.txt new file mode 100755 index 0000000..32780b0 --- /dev/null +++ b/DEV2.1/tp5.txt @@ -0,0 +1,17 @@ +insert into Auteur values (1, 'Proal'); +insert into Auteur values (2, 'laorP'); +insert into Auteur values (3, 'alPro'); +insert into Auteur values (4, 'orPal'); +insert into Editeur values (8, 'CrocsCars'); +insert into Editeur values (9, 'Fesse'); +insert into Editeur values (10, 'LaGlance'); + +2)CREATE TABLE Livre(NumLivre number primary key, Titre varchar(60), CodeEditeur number references Editeur ON DELETE SET NULL); +insert into Livre values(13, 'Heehee', 8); + +DELETE FROM EDITEUR WHERE CodeEditeur = 8; + +3) +CREATE TABLE A_ECRIT(NumAuteur number references AUTEUR ON DELETE SET NULL , NumLivre number references LIVRE ON DELETE CASCADE, Primary key(NumAuteur,NumLivre)); +insert into A_ECRIT values (1, 14); +insert into A_ECRIT values (2, 14); \ No newline at end of file diff --git a/Ireland is the place where it rains the most WRONG.docx b/Ireland is the place where it rains the most WRONG.docx new file mode 100755 index 0000000..22882d1 Binary files /dev/null and b/Ireland is the place where it rains the most WRONG.docx differ diff --git a/tp1.txt b/tp1.txt new file mode 100755 index 0000000..b4d0ea0 --- /dev/null +++ b/tp1.txt @@ -0,0 +1,5 @@ +SELECT Region, count(DISTINCT Cru) FROM Vin GROUP BY Region; +SELECT Nom, NumVitic, count(DISTINCT Cru) FROM Viticulteur NATURAL JOIN Vin GROUP BY Nom, NumVitic; +SELECT NumBuveur, Nom, AVG(Qtte) FROM Buveur NATURAL JOIN Commande WHERE Ville = 'PARIS' GROUP BY NumBuveur, Nom; +SELECT Nom, Count(NumCom) FROM Commande NATURAL JOIN Buveur GROUP BY Nom; +SELECT Nom, COUNT(Qtte) FROM Buveur NATURAL JOIN Commande GROUP BY Nom HAVING AVG(Qtte) >= 12; \ No newline at end of file diff --git a/tp2.txt b/tp2.txt new file mode 100755 index 0000000..c21809b --- /dev/null +++ b/tp2.txt @@ -0,0 +1,5 @@ +CREATE VIEW VinDesViticulteurs (idVin, Cru, idViticulteur, NomViticulteur) AS SELECT NumVin, Cru, NumVitic, Nom FROM Viticulteur NATURAL JOIN Vin WHERE region = 'BOURGOGNE'; +CREATE VIEW NbCommandes (numero, nom, nombre) AS SELECT Buveur.NumBuveur, Buveur.Nom , COUNT(Commande.NumCom) FROM Buveur LEFT JOIN Commande ON Buveur.NumBuveur = Commande.NumBuveur GROUP BY +Buveur.NumBuveur, Buveur.Nom; +SELECT DISTINCT NumVitic, Nom FROM Viticulteur NATURAL JOIN Vin NATURAL JOIN Commande; +SELECT DISTINCT numVitic,nom FROM Viticulteur MINUS SELECT numVitic, nom FROM Viticulteur NATURAL JOIN Vin NATURAL JOIN Commande; diff --git a/tp3.txt b/tp3.txt new file mode 100755 index 0000000..610278b --- /dev/null +++ b/tp3.txt @@ -0,0 +1,29 @@ +ALTER table Viticulteur add NumCav int references Cave_cooperative(NumCav); + +INSERT into Cave_cooperative values(10, 'MACON', 1); + +5) +INSERT INTO Viticulteur values(40, 'WEISS', 'JACQUES', 'COLMAR', NULL); +INSERT into Cave_cooperative values(12, 'STRASBOURG', 40); +UPDATE Viticulteur SET numcav = 12 where numvitic = 40; + +Question 2 +1)CREATE TABLE buveur2(NumBuveur int PRIMARY KEY, Nom Varchar(50), Prenom Varchar(50), Ville Varchar(50)); + +2)ALTER TABLE buveur2 DROP COLUMN VILLE; + +3)CREATE TABLE Commande2(NumCom int PRIMARY KEY, NumBuveur int REFERENCES buveur2(NumBuveur), NumVin int REFERENCES Vin(NumVin), Qtte int, DateCom DATE); + +4)ALTER TABLE buveur2 DROP COLUMN numbuveur; + +Question 3 + +1)ALTER TABLE buveur2 MODIFY Nom VARCHAR(15); + +2)ALTER TABLE buveur2 MODIFY Prenom VARCHAR(5); + +3)ALTER TABLE buveur2 RENAME COLUMN Nom TO NomBuveur; + +4)ALTER TABLE buveur2 RENAME COLUMN numBuveur TO idBuv; + +5) \ No newline at end of file