Skip to content
This repository has been archived by the owner on Mar 8, 2022. It is now read-only.

Commit

Permalink
Merge pull request #7 from Stonks-Life-Inc/java
Browse files Browse the repository at this point in the history
Main menu import -> Main
  • Loading branch information
Ttiki authored Mar 6, 2022
2 parents f349aca + 3d0e0ab commit 3f703fc
Show file tree
Hide file tree
Showing 9 changed files with 296 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path=""/>
<classpathentry kind="output" path=""/>
</classpath>
28 changes: 28 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Projet_POO</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<filteredResources>
<filter>
<id>1645083004464</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
138 changes: 138 additions & 0 deletions Etudiant.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
import java.sql.Date;

public class Etudiant {
// CONSTANTES - non -

// ATTRIBUTS
int id;
int numEtudiant;
String numSecu;
String nom;
String prenom;
String lieuDeNaissance;
Date dateDeNaissance;
String promotion;
String mailPerso;
String mailPro;

// CONSTRUCTEUR singleton
public Etudiant() {

}

public Etudiant(int id, int numEtudiant, String numSecu, String nom, String prenom, String lieuDeNaissance, Date dateDeNaissance, String promotion, String mailPerso, String mailPro) {
this.id = id;
this.numEtudiant = numEtudiant;
this.numSecu = numSecu;
this.nom = nom;
this.prenom = prenom;
this.lieuDeNaissance = lieuDeNaissance;
this.dateDeNaissance = dateDeNaissance;
this.promotion = promotion;
this.mailPerso = mailPerso;
this.mailPro = mailPro;
}

// METHODES D'ENCAPSULATION

public int getId() {
return this.id;
}

public void setId(int id) {
this.id = id;
}

public int getNumEtudiant() {
return this.numEtudiant;
}

public void setNumEtudiant(int numEtudiant) {
this.numEtudiant = numEtudiant;
}

public String getNumSecu() {
return this.numSecu;
}

public void setNumSecu(String numSecu) {
this.numSecu = numSecu;
}

public String getNom() {
return this.nom;
}

public void setNom(String nom) {
this.nom = nom;
}

public String getPrenom() {
return this.prenom;
}

public void setPrenom(String prenom) {
this.prenom = prenom;
}

public String getLieuDeNaissance() {
return this.lieuDeNaissance;
}

public void setLieuDeNaissance(String lieuDeNaissance) {
this.lieuDeNaissance = lieuDeNaissance;
}

public Date getDateDeNaissance() {
return this.dateDeNaissance;
}

public void setDateDeNaissance(Date dateDeNaissance) {
this.dateDeNaissance = dateDeNaissance;
}

public String getPromotion() {
return this.promotion;
}

public void setPromotion(String promotion) {
this.promotion = promotion;
}

public String getMailPerso() {
return this.mailPerso;
}

public void setMailPerso(String mailPerso) {
this.mailPerso = mailPerso;
}

public String getMailPro() {
return this.mailPro;
}

public void setMailPro(String mailPro) {
this.mailPro = mailPro;
}

// METHODES USUELLES

@Override
public String toString() {
return "{" +
" id='" + getId() + "'" +
", numEtudiant='" + getNumEtudiant() + "'" +
", numSecu='" + getNumSecu() + "'" +
", nom='" + getNom() + "'" +
", prenom='" + getPrenom() + "'" +
", lieuDeNaissance='" + getLieuDeNaissance() + "'" +
", dateDeNaissance='" + getDateDeNaissance() + "'" +
", promotion='" + getPromotion() + "'" +
", mailPerso='" + getMailPerso() + "'" +
", mailPro='" + getMailPro() + "'" +
"}";
}

// METHODES SPECIFIQUES

}
111 changes: 111 additions & 0 deletions MainMenu.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
//package utility;

import java.util.Scanner;

public class MainMenu {
private static Scanner menuChoiceScanner = new Scanner(System.in);
public static void main(String[] args) {
int choice;
int choice2;

//Main menu loop
do {
System.out.println("Quel est votre choix ?\n - 1 : Etudiants\n - 2 : Cours\n - 3 : Inscriptions\n - 4 : Notes\n - 5 : Absences\n - 0 : Quitter\n");
//On scan le choix de l'utilisateur
choice = menuChoiceScanner.nextInt(); //Interger,long ... input

switch (choice){

case 0:
choice = -1;
break;


case 1:
do {
System.out.println("Opérations sur les Etudiants :\n - 1 : Ajouter un nouvel étudiant\n - 2 : Lister les étudiants par ordre alphabétique\n - 3 : Lister les étudiants par promotion\n - 4 : Modifier un étudiant\n - 5 : Supprimer un étudiant\n - 0 : Retour\n");
choice2 = menuChoiceScanner.nextInt();
switch (choice2) {
case 0:
break;

default:
break;
}
} while (choice2 != 0);
break;

case 2:
do {
System.out.println("Opérations sur les cours :\n - 1 : Ajouter un nouveau cours\n - 2 : Lister les cours\n - 3 : Modifier un cours\n - 4 : Supprimer un cours");
System.out.println(" - 0 : Retour\n");
choice2 = menuChoiceScanner.nextInt();
switch (choice2) {
case 0:
break;

default:
break;
}

} while (choice2 != 0);
break;

case 3:
do {
System.out.println("Opérations sur les inscriptions :\n - 1 : Ajouter un étudiant à un cours\n - 2 : Supprimer une inscription\n - 3 : Lister les étudiants d'un cours\n - 4 : Lister les cours d'un étudiants");
System.out.println(" - 0 : Retour\n");
choice2 = menuChoiceScanner.nextInt();
switch (choice2) {
case 0:
break;

default:
break;
}

} while (choice2 != 0);
break;

case 4:
do {
System.out.println("Opérations sur les notes :\n - 1 : Créer un examen\n - 2 : Supprimer un examen\n - 3 : Ajouter la note d'un étudiant\n - 4 : Modifier la note d'un étudiant\n - 5 : Supprimer la note d'un étudiant");
System.out.println("Pour un examen, afficher :\n\t Par cours auquel il est inscrit :\n\t - 6 : Ses notes\n\t - 7 : Sa moyenne");
System.out.println("Pour tous les cours auquel il est inscrit :\n\t - 8 : Sa moyenne");
System.out.println(" - 0 : Retour\n");
choice2 = menuChoiceScanner.nextInt();
switch (choice2) {
case 0:
break;

default:
break;
}

} while (choice2 != 0);
break;

case 5:
do {
System.out.println("Opérations sur les absences :\n - 1 : Ajouter une absence\n - 2 : Modifier une absence\n - 3 : Supprimer une absence");
System.out.println("Pour un cours :\n\t - 4 : Lister chronologiquement les absences et donner leur nombre");
System.out.println("Pour un étudiant :\n\t Lister par cours :\n\t - 5 : Chronologiquement ses absences\n\t - 6 : Le nombres d'absences\n - 7 : Le nombre total d'absences");
System.out.println(" - 0 : Retour\n");
choice2 = menuChoiceScanner.nextInt();
switch (choice2) {
case 0:
break;

default:
break;
}

} while (choice2 != 0);
break;

default:
break;
}
}while(choice != -1);
}
}
3 changes: 3 additions & 0 deletions csv/absence.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
1;1;01/01/0101;"maladie";
2;2;01/01/0102;"obseque";
3;3;01/01/0103;"competition";
3 changes: 3 additions & 0 deletions csv/cours.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
1;"Cours1";"NEnseignant1";"PEnseignant1";"mailenseignant1@pro.com";
2;"Cours2";"NEnseignant2";"PEnseignant2";"mailenseignant2@pro.com";
3;"Cours13";"NEnseignant3";"PEnseignant3";"mailenseignant3@pro.com";
3 changes: 3 additions & 0 deletions csv/etudiant.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
1;1111;111111111;"TestNom1";"TestPrenom1";"TestVille1";01/01/0101;"TestL1";"test1@perso.com";"test1@pro.com";
2;2222;222222222;"TestNom2";"TestPrenom2";"TestVille2";02/02/0202;"TestL2";"test2@perso.com";"test2@pro.com";
3;3333;333333333;"TestNom3";"TestPrenom3";"TestVille3";03/03/0303;"TestL3";"test3@perso.com";"test3@pro.com";
Empty file added csv/inscription.csv
Empty file.
Empty file added csv/note.csv
Empty file.

0 comments on commit 3f703fc

Please sign in to comment.