From faee8fb49185dc4f51980d31d7fe9a64d8dee266 Mon Sep 17 00:00:00 2001
From: Malori ALVAREZ <malori.alvarez.etu@univ-lille.fr>
Date: Mon, 10 Mar 2025 09:31:33 +0100
Subject: [PATCH] INIT

---
 lib/tp04-res.jar                 | Bin 0 -> 9883 bytes
 src/tp1/Book.java                |  38 ++++++++
 src/tp1/Irregular.java           |  41 ++++++++
 src/tp1/Parameter.java           |  12 +++
 src/tp2/Competitor.java          |  39 ++++++++
 src/tp2/Dice.java                | 155 +++++++++++++++++++++++++++++++
 src/tp3/Card.java                |  65 +++++++++++++
 src/tp3/Color.java               |   5 +
 src/tp3/Rank.java                |   5 +
 src/tp3/Task.java                |  86 +++++++++++++++++
 src/tp3/TaskStatus.java          |   5 +
 src/tp3/ToDoList.java            |  68 ++++++++++++++
 src/tp3/UseCard.java             |  18 ++++
 src/tp3/UseLocalDate.java        |  56 +++++++++++
 src/tp4/PendingCaseQueue.java    |  86 +++++++++++++++++
 src/tp4/Person.java              |  59 ++++++++++++
 src/tp4/Student.java             |  80 ++++++++++++++++
 src/tp4/StudentAbs.java          |  30 ++++++
 src/tp4/UsePendingCaseQueue.java |  31 +++++++
 src/tp4/UsePerson.java           |  28 ++++++
 src/tp4/UseStudent.java          |  20 ++++
 src/tp4/UseYearGroup.java        |   8 ++
 src/tp4/YearGroup.java           |  28 ++++++
 23 files changed, 963 insertions(+)
 create mode 100755 lib/tp04-res.jar
 create mode 100755 src/tp1/Book.java
 create mode 100755 src/tp1/Irregular.java
 create mode 100755 src/tp1/Parameter.java
 create mode 100755 src/tp2/Competitor.java
 create mode 100755 src/tp2/Dice.java
 create mode 100755 src/tp3/Card.java
 create mode 100755 src/tp3/Color.java
 create mode 100755 src/tp3/Rank.java
 create mode 100755 src/tp3/Task.java
 create mode 100755 src/tp3/TaskStatus.java
 create mode 100755 src/tp3/ToDoList.java
 create mode 100755 src/tp3/UseCard.java
 create mode 100755 src/tp3/UseLocalDate.java
 create mode 100755 src/tp4/PendingCaseQueue.java
 create mode 100755 src/tp4/Person.java
 create mode 100755 src/tp4/Student.java
 create mode 100755 src/tp4/StudentAbs.java
 create mode 100755 src/tp4/UsePendingCaseQueue.java
 create mode 100755 src/tp4/UsePerson.java
 create mode 100755 src/tp4/UseStudent.java
 create mode 100755 src/tp4/UseYearGroup.java
 create mode 100755 src/tp4/YearGroup.java

diff --git a/lib/tp04-res.jar b/lib/tp04-res.jar
new file mode 100755
index 0000000000000000000000000000000000000000..4088fda2baee4ed5f221ddd3c9999890d7f2637f
GIT binary patch
literal 9883
zcmWIWW@h1HVBlb2__`)Ki~$MoFfcGA=jW9a<>wS+ryJ@MtI`OMN;U=thP2GIk_>`s
zii%6{s9^`0lV4hd*C3Fh;?(5)yc9epfm~FQky(UK4J!i!LupB74jyBKPy)+Hzqq&{
zI~|XD4zT*tqGEr4JgOj308v$JKsX9uD)B`Ds+q<_+ipU%N>id$nh~wioM@F6M60wU
zR;8f<9+jZPky??Mi$@7B0|NtCNpeYnp}8SG7xE)3wJ@}d#~0}sijm{}8(MZoafGE2
zvX}5FH8L<lb^>0dhDP`tzz6eMN--!9P<)1NEV^1!%tcPp=;jKdxgjXA1i6?&SB~rq
z^vEEj7N3)modGhJcxQm318>N|3zoo8q!fwnSa=~27^+`vfX}I@Dv=8T{AMB-0_ZA1
zWo}_|E=tjdt_EZ;L``9Gt^q#NP*oxqDfrDqE>iHTM9#4IRU#KDcvYelDd;LeMM_Bu
z-r(V4U|;|%DM>-87toDDR);T|k=5bLK*;LwB?e@5_#zKk9loeTR);U*kk#RfHe_}9
zA`M9$;V3I09AzLSB?W||462S`ltI-Ij54S?NR){%FmP}%+*%VIW^m>Ho_r<-hP5mV
z4AP(^g;1B8my(&6?wnYhs+XLTSX|s2bURNdP$ah9d-;Pc3fsBvMe7?o>xO#n*>WwS
zgP-jv%c17{!v#*u5Aj?&c;x>F*Zm7SrCfXY?Xn)ZOMbUBPSBt6qv%^)^);*X^?RRR
zf1iJ!@s3lZV~65v-dA5InMd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ZVOSp`wdMm{@_K`tHcj)uYwzX_=_LV*dHRO{4n%F$DwdL9Myn&
zYzE+W0cxvv1DXK@TfLxBErbW|W7AI152$7c3!nxd*a@i>`S`to+G=x0GJ{YL3pD@=
z(R31YJgW8unA-8X8&&&xRPB(lNPKA?HR%3f(@xL_sAd=mB7z@zI26A(P|ZjaL~g*M
W4t27EOQRTu7>3s(3=Fft{s#c<TaNGm

literal 0
HcmV?d00001

diff --git a/src/tp1/Book.java b/src/tp1/Book.java
new file mode 100755
index 0000000..228db32
--- /dev/null
+++ b/src/tp1/Book.java
@@ -0,0 +1,38 @@
+package tp1;
+
+class Book {
+    // class attributes
+    String author;
+    String title;
+    int year;
+    // constructor
+    Book(String author, String title, int year) {
+        this.author = author;
+        this.title = title;
+        this.year = year;
+    }
+    // methods
+    String getAuthor() {
+        return this.author;
+    }
+    String getTitle() {
+        return this.title;
+    }
+    String print() {
+        return author + "\t" + title + "\t" + year;
+    }
+}
+
+class UseBook{
+    public static void main(String[] args){
+        Book[] biblio = {
+            new Book("Edwin A. Abbott", "Flatland", 1884),
+            new Book("Edwin A. Abbott", "Flatland", 1885),
+            new Book("Edwin A. Abbott", "Flatland", 1886)
+        };
+ 
+        for (int i = 0; i < biblio.length; i = i + 1) {
+            System.out.println(biblio[i].print());  
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/tp1/Irregular.java b/src/tp1/Irregular.java
new file mode 100755
index 0000000..93cbf3c
--- /dev/null
+++ b/src/tp1/Irregular.java
@@ -0,0 +1,41 @@
+package tp1;
+
+class Irregular{
+
+    int[][] irregular;
+    int[] lineSizeTab;
+
+    Irregular(int[] lineSize){
+        irregular = new int[lineSize.length][3];
+        lineSizeTab = lineSize;
+        randomFilling();
+    }
+
+    void randomFilling(){
+        for (int i = 0; i < irregular.length; i = i + 1) {
+            for(int id = 0; id < lineSizeTab[i]; id++){
+                irregular[i][id] = (int)(Math.random() * 10);
+            }   
+        }
+    }
+
+    String display(){
+        String res = "";
+        for (int i = 0; i < irregular.length; i = i + 1) {
+            for(int id = 0; id < lineSizeTab[i]; id++){
+                res = res + String.valueOf(irregular[i][id]);
+            }   
+            res = res + "\n";
+        }
+
+        return res;
+    }
+
+}
+
+class UseIrregular{
+    public static void main(String[] args){
+        Irregular irr = new Irregular(new int[]{3, 2, 3});
+        System.out.println(irr.display());
+    }
+}
\ No newline at end of file
diff --git a/src/tp1/Parameter.java b/src/tp1/Parameter.java
new file mode 100755
index 0000000..81f18ff
--- /dev/null
+++ b/src/tp1/Parameter.java
@@ -0,0 +1,12 @@
+package tp1;
+
+class Parameter {
+    public static void main(String[] args) {
+        if(args.length==0) {
+            System.out.println("No parameter");
+        }
+        for(int i=0; i<args.length; i++) {
+            System.out.println("(" + (i+1) + ") " + args[i]);
+        }
+    }
+}
diff --git a/src/tp2/Competitor.java b/src/tp2/Competitor.java
new file mode 100755
index 0000000..de1ebca
--- /dev/null
+++ b/src/tp2/Competitor.java
@@ -0,0 +1,39 @@
+class Competitor{
+    int numberSign;
+    int score;
+    int min;
+    int sec;
+
+    Competitor(int numberSign, int score, int min, int sec){
+        if(numberSign > 100 || numberSign < 1){
+            numberSign = -1;
+        }
+        if(score > 60 || score < 0){
+            score = -1;
+        }
+        this.numberSign = numberSign;
+        this.score = score;
+        this.min = min;
+        this.sec = sec;
+    }
+
+    String display(){
+        return "[No"+String.valueOf(numberSign)+","+String.valueOf(score)+"points,"+(sec+min*60)+" s]";
+    }
+}
+
+class Main{
+    public static void main(String[] args){
+
+        Competitor[] competitorTab = new Competitor[100];
+        competitorTab[0] = new Competitor(1,45,15,20);
+        competitorTab[1] = new Competitor(2,32,12,45);
+        competitorTab[2] = new Competitor(5,12,13,59);
+        competitorTab[3] = new Competitor(12,12,15,70);
+        competitorTab[4] = new Competitor(32,75,15,20);
+
+        System.out.println(competitorTab[0].display());
+        System.out.println(competitorTab[1].display());
+        System.out.println(competitorTab[2].display());
+    }
+}
\ No newline at end of file
diff --git a/src/tp2/Dice.java b/src/tp2/Dice.java
new file mode 100755
index 0000000..9b5b8db
--- /dev/null
+++ b/src/tp2/Dice.java
@@ -0,0 +1,155 @@
+class Dice{
+    int numberSides;
+    double rand = 0;
+    int value = 1;
+
+    Dice(int numberSides) {
+        this.numberSides = numberSides;
+
+        if(this.numberSides <= 0) {
+            this.numberSides = 1;
+        }
+    }
+
+    void roll(){
+        this.rand = Math.random() * numberSides;
+        this.value = (int)this.rand; 
+    }
+
+    String display(){
+        return "Dice(" + numberSides+ "faces, " + rand+ " rand, "+this.value+" choisi)";
+    }
+
+    int getValue(){
+        return this.value;
+    }
+}
+
+class DicePlayer{
+    String name;
+    int totalValue = 0;
+    int nbDiceRolls = 0;
+
+    DicePlayer(String name){
+        this.name = name;
+    }
+
+
+    void play(Dice dice6){
+        dice6.roll();
+        this.totalValue = this.totalValue + dice6.getValue();
+        this.nbDiceRolls++;
+    }
+
+    int getTotalValue(){
+        return this.totalValue;
+    }
+
+    int getNbDiceRolls(){
+        return this.nbDiceRolls;
+    }
+
+
+    String displayPlayer(){
+        return this.name+": "+this.totalValue+" points en "+this.nbDiceRolls+" coups.";
+    }
+}
+
+
+class OneDicePlayerGame{
+    public static void main(String[] args){
+        NDicePlayerGame game = new NDicePlayerGame(10);
+        /*
+        DicePlayer dicePlayer = new DicePlayer("Cyprien");
+        while(dicePlayer.getTotalValue() < 20){
+            Dice dice = new Dice(6);
+            
+            dicePlayer.play(dice);
+            System.out.println(dice.display());
+
+        }
+        System.out.println(dicePlayer.displayPlayer());
+
+        DicePlayer dicePlayer2 = new DicePlayer("Gabin");
+        while(dicePlayer2.getTotalValue() < 20){
+            Dice dice = new Dice(6);
+            
+            dicePlayer2.play(dice);
+            System.out.println(dice.display());
+
+        }
+        System.out.println(dicePlayer2.displayPlayer());
+
+        TwoDicePlayerGame twoDicePlayerGame = new TwoDicePlayerGame(dicePlayer, dicePlayer2);
+        System.out.println(twoDicePlayerGame.winner().displayPlayer()+" winner");
+        */
+    }
+}
+
+class TwoDicePlayerGame{
+    DicePlayer dicePlayer1;
+    DicePlayer dicePlayer2;
+
+    TwoDicePlayerGame(DicePlayer dicePlayer1, DicePlayer dicePlayer2){
+        this.dicePlayer1 = dicePlayer1;
+        this.dicePlayer2 = dicePlayer2;
+    }
+
+    DicePlayer winner(){
+        if(dicePlayer1.getTotalValue() > 20 && dicePlayer2.getTotalValue() > 20){
+            if(dicePlayer1.getNbDiceRolls() < dicePlayer2.getNbDiceRolls()){
+                return dicePlayer1;
+            }else if(dicePlayer1.getNbDiceRolls() > dicePlayer2.getNbDiceRolls()){
+                return dicePlayer2;
+            }else{
+                if(dicePlayer1.getTotalValue() > dicePlayer2.getTotalValue()){
+                    return dicePlayer1;
+                }else if(dicePlayer1.getTotalValue() > dicePlayer2.getTotalValue()){
+                    return dicePlayer2;
+                }else{
+                    return null;
+                }
+            }
+        }else{
+            if(dicePlayer1.getTotalValue() > dicePlayer2.getTotalValue()){
+                return dicePlayer1;
+            }else if(dicePlayer1.getTotalValue() > dicePlayer2.getTotalValue()){
+                return dicePlayer2;
+            }else{
+                return null;
+            }
+        }
+    }
+}
+
+class NDicePlayerGame{
+    DicePlayer[] players;
+
+    NDicePlayerGame(int nbPlayer){
+        players = new DicePlayer[nbPlayer];
+        int i = 0;
+        while(i < players.length){
+            players[i] = new DicePlayer(String.valueOf(i));
+            while(players[i].getTotalValue() < 20){
+                Dice dice = new Dice(6);
+                
+                players[i].play(dice);
+                System.out.println(dice.display());
+            }
+            System.out.println(players[i].displayPlayer());
+            i++;
+        }
+        /*
+
+        DicePlayer[] winners = winners();
+
+        for (int place = 0; place < 3; i++){
+            System.out.println(place+"- "+winners[place].displayPlayer());
+        }*/
+
+    }
+/*
+    DicePlayer[] winner(){
+        return Arrays.sort(players.displayPlayer());
+    }*/
+}
\ No newline at end of file
diff --git a/src/tp3/Card.java b/src/tp3/Card.java
new file mode 100755
index 0000000..7635c6b
--- /dev/null
+++ b/src/tp3/Card.java
@@ -0,0 +1,65 @@
+package tp3;
+import tp3.Rank;
+import tp3.Color;
+import java.util.Arrays;
+
+public class Card {
+    private Color color;
+    private Rank rank;
+
+    public Color getColor() {
+        return color;
+    }
+
+    public Rank getRank() {
+        return rank;
+    }
+
+    public String toString() {
+        return this.color+" "+this.rank;
+    }
+
+    public Card(Color color, Rank rank){
+        this.rank=rank;
+        this.color=color;
+    }
+
+    public Card(String color, String rank){
+        this.rank=Rank.valueOf(rank);
+        this.color=Color.valueOf(color);
+    }
+
+    
+    public boolean equals(Card carte){
+        if (this.rank==carte.rank && this.color==carte.color){
+            return true;
+        }
+        return false;
+    }
+
+    public boolean isBefore(Card carte){
+        if (this.rank.ordinal()<carte.rank.ordinal()){
+            return true;
+        }
+        return false;
+    }
+
+    public int compareRank(Card carte){
+        if (this.rank.ordinal()<carte.rank.ordinal()){
+            return -1;
+        }else if (this.rank.ordinal()==carte.rank.ordinal()){
+            return 0;
+        }
+        return 1;
+    }
+
+    public int compareColor(Card carte){
+        if (this.color.ordinal()<carte.color.ordinal()){
+            return -1;
+        }else if (this.color.ordinal()==carte.color.ordinal()){
+            return 0;
+        }
+        return 1;
+    }
+
+}
diff --git a/src/tp3/Color.java b/src/tp3/Color.java
new file mode 100755
index 0000000..113a400
--- /dev/null
+++ b/src/tp3/Color.java
@@ -0,0 +1,5 @@
+package tp3;
+
+public enum Color {
+    CLUB, DIAMOND, HEART, SPADE;
+}
\ No newline at end of file
diff --git a/src/tp3/Rank.java b/src/tp3/Rank.java
new file mode 100755
index 0000000..99afc17
--- /dev/null
+++ b/src/tp3/Rank.java
@@ -0,0 +1,5 @@
+package tp3;
+
+public enum Rank {
+    SEVEN, EIGHT, NINE, TEN, JACK, QUEEN, KING, ACE;
+}
diff --git a/src/tp3/Task.java b/src/tp3/Task.java
new file mode 100755
index 0000000..84c8e85
--- /dev/null
+++ b/src/tp3/Task.java
@@ -0,0 +1,86 @@
+package tp3;
+import tp3.TaskStatus;
+import java.time.LocalDate;
+import java.time.Period;
+
+public class Task {
+    private String idTask;
+    private LocalDate creationDate;
+    private LocalDate deadline;
+    private TaskStatus state;
+    private String description;
+    private int duration;
+
+    private static int counter = 0;
+
+    public void Task(String description, int duration){
+        this.description=description;
+        this.duration=duration;
+        this.creationDate=LocalDate.now();
+        this.state=TaskStatus.TODO;
+        this.deadline=creationDate.plusDays(duration);
+        counter++;
+        this.idTask= String.valueOf(LocalDate.now().getYear()).substring(String.valueOf(LocalDate.now().getYear()).length() - 2, String.valueOf(LocalDate.now().getYear()).length())
+                    +String.valueOf(LocalDate.now().getMonth())  + String.valueOf(counter);
+    }
+
+    public void Task(String description, LocalDate creation, LocalDate deadline, int duration){
+        this.description=description;
+        this.creationDate=creation;
+        this.deadline=deadline;
+        this.duration=duration;
+        this.state=TaskStatus.TODO;
+        counter++;
+        this.idTask= String.valueOf(LocalDate.now().getYear()).substring(String.valueOf(LocalDate.now().getYear()).length() - 2, String.valueOf(LocalDate.now().getYear()).length())
+                    +String.valueOf(LocalDate.now().getMonth())  + String.valueOf(counter);
+    }
+
+    public String toString() {
+        return "(T"+idTask+" = "+description+":"+state+"("+duration+")"+" :"+deadline;
+    }
+
+    void changeStatus(TaskStatus st){
+        this.state=st;
+    }
+
+    void changeStatus(char c){
+        if (c=='T'){
+            this.state=TaskStatus.TODO;
+        }else if (c=='O'){
+            this.state=TaskStatus.ONGOING;
+        }else if (c=='D'){
+            this.state=TaskStatus.DELAYED;
+        }else if (c=='F'){
+            this.state=TaskStatus.FINISHED;
+        }
+    }
+
+    void changeStatus(){
+        int index=this.state.ordinal();
+        this.state=TaskStatus.values()[(index+1)%TaskStatus.values().length];
+    }
+
+    boolean isLate(){
+        Period period=LocalDate.now().until(this.deadline);
+        if(period.isNegative()){
+            return true;
+        }
+        return false;
+    }
+
+    void delay(int nbDays){
+        this.deadline=this.deadline.plusDays(nbDays);
+    }
+
+    LocalDate getDeadline(){
+        return this.deadline;
+    }
+
+    LocalDate getCreationDate(){
+        return this.creationDate;
+    }
+
+    Period getDuration(){
+        return this.creationDate.until(this.deadline);
+    }  
+}
\ No newline at end of file
diff --git a/src/tp3/TaskStatus.java b/src/tp3/TaskStatus.java
new file mode 100755
index 0000000..a043094
--- /dev/null
+++ b/src/tp3/TaskStatus.java
@@ -0,0 +1,5 @@
+package tp3;
+
+public enum TaskStatus {
+    TODO, ONGOING, DELAYED, FINISHED;
+}
diff --git a/src/tp3/ToDoList.java b/src/tp3/ToDoList.java
new file mode 100755
index 0000000..6328dc7
--- /dev/null
+++ b/src/tp3/ToDoList.java
@@ -0,0 +1,68 @@
+package tp3;
+import java.util.*;
+import java.time.LocalDate;
+
+public class ToDoList {
+    private List<Task> chores = new ArrayList<Task>();
+
+    public void ToDoList(){
+        
+    }
+
+    public String toString(){
+        return ""+this.chores;
+    }
+
+    void addTask(Task aTask){
+        chores.add(aTask);
+    }
+
+    void removeTask(int i){
+        chores.remove(i);
+    }
+
+    void removeTask(Task aTask){
+        int i = chores.indexOf(aTask);
+        chores.remove(i);
+    }
+
+    boolean isOverwhelmed(){
+        if(chores.get(chores.size() - 1) == null){
+            return false;
+        }
+
+        return true;
+    }
+
+    int getNbTask(){
+        return chores.size();
+    }
+
+    void onSickLeave(int nbDays){
+        for (int ind = 0; ind < chores.size(); ind = ind + 1) {
+            chores.get(ind).delay(nbDays);
+        }
+    }
+
+
+    List<Task> dueTasks(){
+        List<Task> res = new ArrayList<Task>();
+        for (int ind = 0; ind < chores.size(); ind = ind + 1) {
+            if(chores.get(ind).getDeadline() == LocalDate.now()){
+                res.add(chores.get(ind));
+            }
+        }
+
+        return res;
+    }
+
+/*
+    void durationSort(){
+        chores.sort((Task o1, Task o2)->o1.getDuration().getDays().compareTo(o2.getDuration().getDays()));	
+    }
+
+    void senioritySort(){
+        chores.sort((Task o1, Task o2)->o1.getCreationDate().compareTo(o2.getCreationDate()));	
+    }*/
+
+}
diff --git a/src/tp3/UseCard.java b/src/tp3/UseCard.java
new file mode 100755
index 0000000..c1337f8
--- /dev/null
+++ b/src/tp3/UseCard.java
@@ -0,0 +1,18 @@
+package tp3;
+import tp3.Card;
+import tp3.Color;
+import tp3.Rank;
+
+public class UseCard {
+    public static void main(String[] args){
+        Card c1 = new Card("CLUB", "NINE");
+        Card c2 = new Card(Color.SPADE, Rank.ACE);
+        System.out.println(c1.getColor());
+        System.out.println(c2.getRank());
+        System.out.println(c1.compareColor(c2));
+        System.out.println(c1.compareRank(c2));
+        System.out.println(c1.isBefore(c2));
+        System.out.println(c1.equals(c2));
+        System.out.println(c1.toString());
+    }
+}
diff --git a/src/tp3/UseLocalDate.java b/src/tp3/UseLocalDate.java
new file mode 100755
index 0000000..d663a4c
--- /dev/null
+++ b/src/tp3/UseLocalDate.java
@@ -0,0 +1,56 @@
+package tp3;
+import java.time.LocalDate;
+import java.time.Period;
+import java.util.Scanner;
+
+public class UseLocalDate {
+    
+    public static String dateOfTheDay(){
+        return "Today's date "+LocalDate.now();
+    }
+
+    public static LocalDate inputDate(){
+        Scanner input = new Scanner(System.in);  // Create a Scanner object
+        
+        System.out.println("Enter day");
+        int day = input.nextInt();
+        if(day < 1){
+            day = 1;
+        }else{
+            if(day > 31){
+                day = 31;
+            }
+        }
+
+        System.out.println("Enter month");
+        int month = input.nextInt();
+        if(month < 1){
+            month = 1;
+        }else{
+            if(month > 12){
+                month = 12;
+            }
+        }
+
+        System.out.println("Enter year");
+        int year = input.nextInt();
+        if(year < 0){
+            year = 0;
+        }
+
+        return LocalDate.of(year, month, day);
+    }
+
+    public static String diffDate(){
+        LocalDate date1=inputDate();
+        LocalDate date2=inputDate();
+        Period period=date1.until(date2);
+        return period.toString();
+    }
+
+    public static void main(String[] args){
+        System.out.println(dateOfTheDay());
+        System.out.println(inputDate().toString());
+        System.out.println(diffDate());
+    }
+}
diff --git a/src/tp4/PendingCaseQueue.java b/src/tp4/PendingCaseQueue.java
new file mode 100755
index 0000000..bd9a699
--- /dev/null
+++ b/src/tp4/PendingCaseQueue.java
@@ -0,0 +1,86 @@
+package tp4;
+import tpOO.tp04.*;
+
+public class PendingCaseQueue{
+    public final static int CAPACITY = 10;
+
+    int id;
+
+    PendingCase[] pendingCases;
+
+    PendingCaseQueue(){     
+        pendingCases = new PendingCase[CAPACITY];
+
+    }
+
+    void clear(){
+        pendingCases = new PendingCase[CAPACITY];
+    }
+
+    boolean isEmpty(){
+        if(pendingCases[0]==null){
+            return true;
+        }
+        return false;
+    }
+
+    boolean isFull(){
+        if(pendingCases.length == CAPACITY){
+            return true;
+        }
+        return false;
+    }
+
+    int size(){
+        return pendingCases.length;
+    }
+
+    void addOne(PendingCase other){
+        if(isFull()){
+            System.out.println("impossible");
+        }else{
+            PendingCase[] before = pendingCases;
+            PendingCase[] newGrade = new PendingCase[pendingCases.length + 1];
+
+            for (int notes = 0; notes < before.length; notes = notes + 1) {
+                newGrade[notes] = before[notes];
+            }
+
+            newGrade[newGrade.length] = other;
+
+            pendingCases = newGrade;
+        }   
+    }
+
+    PendingCase removeOne(){
+        if(isEmpty()){
+            return null;
+        }else{
+            PendingCase[] before = pendingCases;
+            PendingCase[] newGrade = new PendingCase[pendingCases.length - 1];
+
+            for (int notes = 0; notes < before.length - 1; notes = notes + 1) {
+                newGrade[notes] = before[notes];
+            }
+            
+            pendingCases = newGrade;
+        } 
+
+        return null;
+    }
+
+
+    public String toString(){
+        String res = "";
+        for (int name = 0; name < pendingCases.length; name++) {
+            if(pendingCases[name] != null){
+            res =  res + pendingCases[name]+"\n";
+            }else{}
+            
+        }
+
+        return res;
+    }
+
+
+}
\ No newline at end of file
diff --git a/src/tp4/Person.java b/src/tp4/Person.java
new file mode 100755
index 0000000..34e4c0a
--- /dev/null
+++ b/src/tp4/Person.java
@@ -0,0 +1,59 @@
+package tp4;
+
+public class Person{
+    private static int ID = -1; //pour être à 0 sur la première assignation 
+    private String forename;
+    private String name;
+
+    public Person(String forename, String name){
+        this.forename = forename;
+        this.name = name;
+        ID++; //assignation automatique
+    }
+
+
+//getters
+
+    int getID() { 
+        return this.ID;
+    }
+
+    String getForename(){
+        return this.forename;
+    }
+
+    String getName(){
+        return this.name;
+    }
+
+
+//setters
+    void setName(String name){
+        this.name = name;
+    }
+
+    void setForename(String forename){
+        this.forename = forename;
+    }
+
+    public String toString(){
+        return getID()+":"+getForename()+" "+getName();
+    }
+
+    
+
+    public boolean equals(Object obj) {
+        if(this == obj) return true;
+        if(obj == null) return false;
+        if(getClass() != obj.getClass()) return false;
+        Person other = (Person) obj;
+        if(ID != other.ID) return false;
+        if (name == null) {
+            if (other.name != null) return false;
+        } else if (!name.equals(other.name)) return false;
+        if (forename == null) {
+            if (other.forename != null) return false;
+        } else if (!forename.equals(other.forename)) return false;
+        return true;
+    }
+}
\ No newline at end of file
diff --git a/src/tp4/Student.java b/src/tp4/Student.java
new file mode 100755
index 0000000..681ee8b
--- /dev/null
+++ b/src/tp4/Student.java
@@ -0,0 +1,80 @@
+package tp4;
+import tp4.Person;
+
+public class Student{
+    private double[] grades;
+    private Person person;
+
+    Student(Person pers, double[] grades){
+        this.person = pers;
+        this.grades = grades;
+    }
+
+    Student(String forename, String name, double[] grades){
+        this(forename, name);
+        this.grades = grades;
+    }
+
+    private Student(String forename, String name){
+        person = new Person(forename, name);
+    }
+
+    int getID() { 
+        return person.getID();
+    }
+
+    String getForename(){
+        return person.getForename();
+    }
+
+    String getName(){
+        return person.getName();
+    }
+/*
+    double[] getGrade(){
+        return thid.grades;
+    }*/
+
+    void setName(String name){
+        person.setName(name);
+    }
+
+    void setForename(String forename){
+        person.setForename(forename);
+    }
+
+
+    double getAverage(){
+        if(this.grades.length == 0) return 0.0;
+        double total = 0;
+        for (int notes = 0; notes < this.grades.length; notes = notes + 1) {
+            total = total + this.grades[notes];
+        }
+
+        return total/this.grades.length;
+    }
+
+    public String toString(){
+        String res;
+        res = "Student["+getID()+":"+ getForename()+" "+getName()+" = [";
+        for (int notes = 0; notes < this.grades.length; notes = notes + 1) {
+            res = res + this.grades[notes]+", ";
+        }
+
+        res = res + "]]"; 
+
+        return res;
+    }
+
+
+    void addGrade(double aGrade){
+        double[] before = this.grades;
+        double[] newGrade = new double[this.grades.length + 1];
+
+        for (int notes = 0; notes < before.length; notes = notes + 1) {
+            newGrade[notes] = before[notes];
+        }
+
+        newGrade[newGrade.length - 1] = aGrade;
+    }
+}
\ No newline at end of file
diff --git a/src/tp4/StudentAbs.java b/src/tp4/StudentAbs.java
new file mode 100755
index 0000000..64f803b
--- /dev/null
+++ b/src/tp4/StudentAbs.java
@@ -0,0 +1,30 @@
+package tp4;
+import tp4.Student;
+
+public class StudentAbs{
+    public Student student;
+    private int nbAbsence;
+
+    StudentAbs(Student student, int nbAbsence){
+        this.student = student;
+        this.nbAbsence = nbAbsence;
+    }
+
+    public String toString(){
+        return student.toString()+" nbAbs="+nbAbsence;
+    }
+
+    boolean warning(int thresholdAbs, double thresholdAvg){
+        if(thresholdAbs <= nbAbsence) return true;
+        if(student.getAverage() <= thresholdAvg) return true;
+
+        return false;
+    }
+
+
+    boolean validation(int thresholdAbs, double thresholdAvg){
+        if(thresholdAbs >= nbAbsence && student.getAverage() >= thresholdAvg) return true;
+
+        return false;
+    }
+}
\ No newline at end of file
diff --git a/src/tp4/UsePendingCaseQueue.java b/src/tp4/UsePendingCaseQueue.java
new file mode 100755
index 0000000..665a3bb
--- /dev/null
+++ b/src/tp4/UsePendingCaseQueue.java
@@ -0,0 +1,31 @@
+package tp4;
+import tpOO.tp04.PendingCase;
+
+public class UsePendingCaseQueue {
+    public static void main(String[] args) {
+        PendingCase pc1 = new PendingCase("Alice", "AAA", 1234.56);
+	    PendingCase pc2 = new PendingCase("Bruno", "BBB", 0.42);
+	    PendingCase pc3 = new PendingCase("Chloé", "CCC", 745.99); 
+	    PendingCase pc4 = new PendingCase("Denis", "DDD", 125.0); 
+
+		//PendingCaseQueue.CAPACITY = 3;
+        PendingCaseQueue pcq = new PendingCaseQueue();
+        System.out.println("Before anything: " + pcq);
+        System.out.println("Empty? " + pcq.isEmpty() + "\tFull? " + pcq.isFull());
+        pcq.addOne(pc1);
+        pcq.addOne(pc2);
+        System.out.println("After addition of pc1 and pc2: " + pcq);
+        System.out.println("Empty? " + pcq.isEmpty() + "\tFull? " + pcq.isFull());
+        pcq.addOne(pc3);
+        System.out.println("After addition of pc3: " + pcq);
+        System.out.println("Empty? " + pcq.isEmpty() + "\tFull? " + pcq.isFull());
+		pcq.addOne(pc4);
+        System.out.println("After addition of pc4: \t" + pcq);
+        pcq.removeOne();
+        System.out.println("After a removal: " + pcq);
+        pcq.addOne(pc1);
+        System.out.println("After addition of pc1: " + pcq);
+        pcq.clear();
+        System.out.println("After clearing: " + pcq);
+    }
+}
diff --git a/src/tp4/UsePerson.java b/src/tp4/UsePerson.java
new file mode 100755
index 0000000..949f445
--- /dev/null
+++ b/src/tp4/UsePerson.java
@@ -0,0 +1,28 @@
+package tp4;
+
+public class UsePerson {
+	public static void main(String[] args) {
+		Person alice = new Person("Alice", "A");
+		Person bruno = new Person("Bruno", "B");
+		Person autre = alice;
+		boolean testsOK = true;
+		// test des getters
+		if(!alice.getForename().equals("Alice") || !alice.getName().equals("A") || !bruno.getForename().equals("Bruno") || !bruno.getName().equals("B") || !autre.getForename().equals("Alice") || !autre.getName().equals("A")) {
+			System.out.println("Erreur de méthodes GET");
+			testsOK = false;
+		}
+		// test des setters
+		alice.setForename("Anatole");
+		bruno.setName("BB");
+		if(!alice.getForename().equals("Anatole") || !alice.getName().equals("A") || !bruno.getForename().equals("Bruno") || !bruno.getName().equals("BB") || !autre.getForename().equals("Anatole") || !autre.getName().equals("A")) {
+			System.out.println("Erreur de méthodes SET");
+			testsOK = false;
+		}
+		// test du equals
+		if(alice.equals(bruno) || !alice.equals(autre)) {
+			System.out.println("Erreur de méthode equals");
+			testsOK = false;
+		}
+		if(testsOK) System.out.println("Tests de UsePerson réussis !");
+	}
+}
diff --git a/src/tp4/UseStudent.java b/src/tp4/UseStudent.java
new file mode 100755
index 0000000..07e0756
--- /dev/null
+++ b/src/tp4/UseStudent.java
@@ -0,0 +1,20 @@
+package tp4;
+import tp4.Student;
+import tp4.Person;
+
+class UseStudent{
+    public static void main(String[] args){
+        Student a = new Student("A", "a", new double[]{1, 2, 3});
+        System.out.println(a.toString());
+        System.out.println(a.getAverage());
+
+        Student b = new Student(new Person("Bruno", "B"), new double[]{1, 2, 3, 4});
+        System.out.println(b.toString());
+        System.out.println(b.getAverage());
+
+
+        Student c = new Student("C", "c", new double[]{1, 2, 3});
+        System.out.println(c.toString());
+        System.out.println(c.getAverage());
+    }
+}
\ No newline at end of file
diff --git a/src/tp4/UseYearGroup.java b/src/tp4/UseYearGroup.java
new file mode 100755
index 0000000..f14285a
--- /dev/null
+++ b/src/tp4/UseYearGroup.java
@@ -0,0 +1,8 @@
+package tp4;
+import tp4.YearGroup;
+
+class UseYearGroup{
+    public static void main(String[] args){
+
+    }
+}
\ No newline at end of file
diff --git a/src/tp4/YearGroup.java b/src/tp4/YearGroup.java
new file mode 100755
index 0000000..8434341
--- /dev/null
+++ b/src/tp4/YearGroup.java
@@ -0,0 +1,28 @@
+package tp4;
+import tp4.Student;
+
+class YearGroup{
+    StudentAbs[] studentAbs;
+
+    YearGroup(StudentAbs[] studentAbs){
+        this.studentAbs = studentAbs;
+    }
+
+    void addGrades(double[] aTest){
+        for (int s = 0; s < studentAbs.length; s = s + 1) {
+            for (int notes = 0; notes < aTest.length; notes = notes + 1) {
+                studentAbs[s].student.addGrade(aTest[notes]);
+            }
+            
+        }
+    }
+
+    void validation(int thresholdAbs, int thresholdAvg){
+        for (int i = 0; i < studentAbs.length; i = i + 1) {
+            if(studentAbs[i].validation(thresholdAbs, thresholdAvg)){
+                System.out.println(studentAbs[i].toString());
+            }
+        }
+    }
+
+}
\ No newline at end of file
-- 
GitLab