master
Kyllian Chabanon 2 years ago
commit ef08852759

Binary file not shown.

@ -1,56 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
int main(int argc, char** argv) {
// Ouverture du fichier en mode écriture
FILE* f = fopen("resultats.txt", "w");
if (f == NULL) {
printf("Error opening file!\n");
exit(1);
}
// Initialisation du générateur de nombres aléatoires
srand(time(0));
// Écriture des en-têtes de colonnes
fprintf(f, "Numero de candidat\tNom\tPrenom\tNote de maths\tNote de francais\tNote d'anglais\tNote de specialite\tNombre de choix de candidatures\tVille choisie de la premiere candidature\tDepartement\tDecision du departement\tValidation\n");
// Génération de données aléatoires pour chaque candidat
for (int i = 1; i <= 100; i++) {
char nom[21];
for (int j = 0; j < 20; j++) {
nom[j] = rand() % 26 + 'a';
}
nom[0] = toupper(nom[0]);
char prenom[21];
for (int j = 0; j < 20; j++) {
prenom[j] = rand() % 26 + 'a';
}
char note_maths[3];
sprintf(note_maths, "%d", rand() % 21);
char note_francais[3];
sprintf(note_francais, "%d", rand() % 21);
char note_anglais[3];
sprintf(note_anglais, "%d", rand() % 21);
char note_specialite[3];
sprintf(note_specialite, "%d", rand() % 21);
char nb_choix[2];
sprintf(nb_choix, "%d", rand() % 6);
char ville[] = "Clermont-Ferrand";
char departement1[14];
sprintf(departement1, "Departement%d", rand() % 21);
char departement2[14];
sprintf(departement2, "Departement%d", rand() % 21);
char departement3[14];
sprintf(departement3, "Departement%d", rand() % 21);
char departement4[14];
sprintf(departement4, "Departement%d", rand() % 21);
char departement5[14];
sprintf(departement5, "Departement%d", rand() % 21);
char decision[] = "0";
char validation[] = "0";
}
}

@ -1,50 +0,0 @@
import random
# Ouverture du fichier en mode écriture
with open("resultats.txt", "w") as f:
# Écriture des en-têtes de colonnes
f.write("Numero de candidat\tNom\tPrenom\tNote de maths\tNote de francais\tNote d'anglais\tNote de specialite\tNombre de choix de candidatures\tVille choisie de la premiere candidature\tDepartement\tDecision du departement\tValidation\n")
# Génération de données aléatoires pour chaque candidat
for i in range(1, 100):
nom = "Nom" + str(i)
prenom = "Prenom" + str(i)
note_maths = str(random.randint(0, 20))
note_francais = str(random.randint(0, 20))
note_anglais = str(random.randint(0, 20))
note_specialite = str(random.randint(0, 20))
nb_choix = str(random.randint(1, 5))
ville1 = "Ville" + str(random.randint(1, 60))
ville2 = "Ville" + str(random.randint(1, 60))
ville3 = "Ville" + str(random.randint(1, 60))
ville4 = "Ville" + str(random.randint(1, 60))
ville5 = "Ville" + str(random.randint(1, 60))
ville1 != ville2 != ville3 != ville4 != ville5
departement1 = "Departement" + str(random.randint(1, 20))
departement2 = "Departement" + str(random.randint(1, 20))
departement3 = "Departement" + str(random.randint(1, 20))
departement4 = "Departement" + str(random.randint(1, 20))
departement5 = "Departement" + str(random.randint(1, 20))
decision1 = str(random.randint(-1, 1))
decision2 = str(random.randint(-1, 1))
decision3 = str(random.randint(-1, 1))
decision4 = str(random.randint(-1, 1))
decision5 = str(random.randint(-1, 1))
validation1 = str(random.randint(0, 1))
validation2 = str(random.randint(0, 1))
validation3 = str(random.randint(0, 1))
validation4 = str(random.randint(0, 1))
validation5 = str(random.randint(0, 1))
#f.write(str(i) + "\t" + nom + "\t" + prenom + "\t" + note_maths + "\t" + note_francais + "\t" + note_anglais + "\t" + note_specialite + "\t" + nb_choix + "\t" + ville + "\t" + departement + "\t" + decision + "\t" + validation + "\n" )
# Écriture des données dans le fichier, séparées par des points-virgules
if nb_choix == "1":
f.write(str(i) + "\t" + nom + "\t" + prenom + "\t" + note_maths + "\t" + note_francais + "\t" + note_anglais + "\t" + note_specialite + "\t" + nb_choix + "\t" + ville1 + "\t" + departement1 + "\t" + decision1 + "\t" + validation1 + "\n")
elif nb_choix == "2":
f.write(str(i) + "\t" + nom + "\t" + prenom + "\t" + note_maths + "\t" + note_francais + "\t" + note_anglais + "\t" + note_specialite + "\t" + nb_choix + "\t" + ville1 + "\t" + departement1 + "\t" + decision1 + "\t" + validation1 + "\t" + ville2 + "\t" + departement2 + "\t" + decision2 + "\t" + validation2 + "\n")
elif nb_choix == "3":
f.write(str(i) + "\t" + nom + "\t" + prenom + "\t" + note_maths + "\t" + note_francais + "\t" + note_anglais + "\t" + note_specialite + "\t" + nb_choix + "\t" + ville1 + "\t" + departement1 + "\t" + decision1 + "\t" + validation1 + "\t" + ville2 + "\t" + departement2 + "\t" + decision2 + "\t" + validation2 + "\t" + ville3 + "\t" + departement3 + "\t" + decision3 + "\t" + validation3 + "\n")
elif nb_choix == "4":
f.write(str(i) + "\t" + nom + "\t" + prenom + "\t" + note_maths + "\t" + note_francais + "\t" + note_anglais + "\t" + note_specialite + "\t" + nb_choix + "\t" + ville1 + "\t" + departement1 + "\t" + decision1 + "\t" + validation1 + "\t" + ville2 + "\t" + departement2 + "\t" + decision2 + "\t" + validation2 + "\t" + ville3 + "\t" + departement3 + "\t" + decision3 + "\t" + validation3 + "\t" + ville4 + "\t" + departement4 + "\t" + decision4 + "\t" + validation4 + "\n")
elif nb_choix == "5":
f.write(str(i) + "\t" + nom + "\t" + prenom + "\t" + note_maths + "\t" + note_francais + "\t" + note_anglais + "\t" + note_specialite + "\t" + nb_choix + "\t" + ville1 + "\t" + departement1 + "\t" + decision1 + "\t" + validation1 + "\t" + ville2 + "\t" + departement2 + "\t" + decision2 + "\t" + validation2 + "\t" + ville3 + "\t" + departement3 + "\t" + decision3 + "\t" + validation3 + "\t" + ville4 + "\t" + departement4 + "\t" + decision4 + "\t" + validation4 + "\t" + ville5 + "\t" + departement5 + "\t" + decision5 + "\t" + validation5 + "\n")

@ -1,38 +0,0 @@
import random
import string
# Ouverture du fichier en mode écriture
with open("resultats.txt", "w") as f:
# Écriture des en-têtes de colonnes
# Génération de données aléatoires pour chaque candidat
for i in range(1, 100):
nom = ''.join(random.choices(string.ascii_lowercase, k=20))
nom = nom.capitalize()
prenom = ''.join(random.choices(string.ascii_lowercase, k=20))
note_maths = str(random.randint(0, 20))
note_francais = str(random.randint(0, 20))
note_anglais = str(random.randint(0, 20))
note_specialite = str(random.randint(0, 20))
nb_choix = str(random.randint(1, 5))
ville = "Clermont-Ferrand"
departement1 = "Departement" + str(random.randint(1, 20))
departement2 = "Departement" + str(random.randint(1, 20))
departement3 = "Departement" + str(random.randint(1, 20))
departement4 = "Departement" + str(random.randint(1, 20))
departement5 = "Departement" + str(random.randint(1, 20))
departement1 != departement2 != departement3 != departement4 != departement5
decision = "0"
validation = "0"
#f.write(str(i) + "\t" + nom + "\t" + prenom + "\t" + note_maths + "\t" + note_francais + "\t" + note_anglais + "\t" + note_specialite + "\t" + nb_choix + "\t" + ville + "\t" + departement + "\t" + decision + "\t" + validation + "\n" )
# Écriture des données dans le fichier, séparées par des points-virgules
if nb_choix == "1":
f.write(str(i) + "\n" + nom + "\n" + prenom + "\n" + note_maths + "\t" + note_francais + "\t" + note_anglais + "\t" + note_specialite + "\n" + nb_choix + "\n" + ville + "\n" + departement1 + "\n" + decision + "\n" + validation + "\n")
elif nb_choix == "2":
f.write(str(i) + "\n" + nom + "\n" + prenom + "\n" + note_maths + "\t" + note_francais + "\t" + note_anglais + "\t" + note_specialite + "\n" + nb_choix + "\n" + ville + "\n" + departement1 + "\n" + decision + "\n" + validation + "\n" + ville + "\n" + departement2 + "\n" + decision + "\n" + validation + "\n")
elif nb_choix == "3":
f.write(str(i) + "\n" + nom + "\n" + prenom + "\n" + note_maths + "\t" + note_francais + "\t" + note_anglais + "\t" + note_specialite + "\n" + nb_choix + "\n" + ville + "\n" + departement1 + "\n" + decision + "\n" + validation + "\n" + ville + "\n" + departement2 + "\n" + decision + "\n" + validation + "\n" + ville + "\n" + departement3 + "\n" + decision + "\n" + validation + "\n")
elif nb_choix == "4":
f.write(str(i) + "\n" + nom + "\n" + prenom + "\n" + note_maths + "\t" + note_francais + "\t" + note_anglais + "\t" + note_specialite + "\n" + nb_choix + "\n" + ville + "\n" + departement1 + "\n" + decision + "\n" + validation + "\n" + ville + "\n" + departement2 + "\n" + decision + "\n" + validation + "\n" + ville + "\n" + departement3 + "\n" + decision + "\n" + validation + "\n" + ville + "\n" + departement4 + "\n" + decision + "\n" + validation + "\n")
elif nb_choix == "5":
f.write(str(i) + "\n" + nom + "\n" + prenom + "\n" + note_maths + "\t" + note_francais + "\t" + note_anglais + "\t" + note_specialite + "\n" + nb_choix + "\n" + ville + "\n" + departement1 + "\n" + decision + "\n" + validation + "\n" + ville + "\n" + departement2 + "\n" + decision + "\n" + validation + "\n" + ville + "\n" + departement3 + "\n" + decision + "\n" + validation + "\n" + ville + "\n" + departement4 + "\n" + decision + "\n" + validation + "\n" + ville + "\n" + departement5 + "\n" + decision + "\n" + validation + "\n")

@ -1 +0,0 @@
Numero de candidat Nom Prenom Note de maths Note de francais Note d'anglais Note de specialite Nombre de choix de candidatures Ville choisie de la premiere candidature Departement Decision du departement Validation

22
SAE.h

@ -49,8 +49,6 @@ void modificationNbPDeptResp(VilleIUT *tiut[], int nbIUT, char respVille[30], ch
void afficherCandidatsAdmis(Etudiant *tetud[], int nbCandidats);
void afficherCandidatsRefuses(Etudiant *tetud[], int nbCandidats);
void afficherCandidatsAttente(Etudiant *tetud[], int nbCandidats);
Etudiant moyenneCandidat(Etudiant mEtudiant);
Etudiant *moyenneCandidats(Etudiant *tetud[], int nbCandiats);
Etudiant modifStatueCandidat(Etudiant *tetud[], int nbCandidats, float noteMin[], VilleIUT *tiut[], int nbIUT, char respVille[30], char respDept[30]);
void statueCandidat(Etudiant *tetud[], int nbCandidats, Etudiant *tetudAdmis[], Etudiant *tetudAttente[], int *nbEtudAdmis, int *nbEtudAttente);
int nbCandidatsAdmis(Etudiant *tetud[], int nbCandidats);
@ -61,32 +59,14 @@ void ajouterCandidature(Etudiant *tetud[], int nbCandidats, VilleIUT *tiut[], in
void supprimerCandidature(Etudiant *tetud[], int nbCandidats);
int inscription(Etudiant *tetud[], int nbCandidats, VilleIUT *tiut[], int nbVillesIUT);
/* Authentification */
// int ConnexionUtilisateur(char *login, char *mdp);
// ListeUtilisateurs chargerUtilisateurs(char *ficUtilisateurs, ListeUtilisateurs Utilisateurs);
// Utilisateur lireUtilisateur(FILE *flot);
// void afficherUtilisateur(Utilisateur utilisateur);
// void afficherUtilisateurs(ListeUtilisateurs listeUtilisateurs);
// ListeUtilisateurs insererUtilisateur(ListeUtilisateurs listeUtilisateurs, Utilisateur utilisateur);
// ListeUtilisateurs supprimerUtilisateur(ListeUtilisateurs listeUtilisateurs, char *nomUtilisateur);
// int videUtilisateurs(ListeUtilisateurs listeUtilisateurs);
// void sauveUtilisateurs(char *ficUtilisateurs, ListeUtilisateurs listeUtilisateurs);
// int rechercherUtilisateur(ListeUtilisateurs listeUtilisateurs, char *nomUtilisateur);
// int supprimerUtilisateur(ListeUtilisateurs listeUtilisateurs, char *nomUtilisateur);
// int menuUtilisateur(ListeUtilisateurs listeUtilisateurs);
// void global(void);
int plusPetit(Etudiant *tetudResp[], int nbCandResp);
void echanger(Etudiant *tetudResp[], int i, int j);
void triNote(Etudiant *tetudResp[], int nbCandResp);
void deptResp(VilleIUT *tiut[], int nbVilles, char respVille[], char respIUT[]);
int chargementRespDept(Etudiant *tetud[], int nbCand, char respVille[], char respIUT[], Etudiant *tetudResp[]);
void lancerAdmissions(Etudiant *tetudResp[], int nbCandResp, Etudiant *tetudAdmis[], int *nbEtudAdmis, Etudiant *tetudAttente[], int *nbEtudAttente, char ville[], char dept[]);
void sauvegardeAdmis(Etudiant *tetudAdmis[], int nbEtudAdmis);
void sauvegardeAttente(Etudiant *tetudAttente[], int nbEtudAttente);
void sauvegardeTousCandidats(Etudiant *tetud[], int nbCandidats);
void libererEspaceCandidats(Etudiant *tetud[], int nbCandidats);
void libererEspaceIUT(VilleIUT *tiut[], int nbIUT);
char *chargerMdPAdmin();
void modifierMdPAdmin();
void libererEspaceIUT(VilleIUT *tiut[], int nbIUT);

Binary file not shown.

@ -154,37 +154,4 @@ void stopperPhaseCandidature(bool *phaseCandidature, bool *phaseTraitement)
{
printf("La phase de candidature est déjà fermée.\n");
}
}
// char *chargerMdPAdmin(void)
// {
// FILE *flot;
// flot = fopen("mdpAdmin.bin", "rb");
// if (flot == NULL)
// {
// printf("Erreur lors de l'ouverture du fichier mdpAdmin.bin\n");
// exit(1);
// }
// char mdp[30];
// fread(mdp, sizeof(char), 30, flot);
// fclose(flot);
// return mdp;
// }
// void modifierMdPAdmin(void)
// {
// char mdp[30];
// FILE *flot;
// flot = fopen("mdpAdmin.bin", "wb");
// if (flot == NULL)
// {
// printf("Erreur lors de l'ouverture du fichier mdpAdmin.txt\n");
// return;
// }
// printf("Entrez le nouveau mot de passe de l'administrateur :\n> ");
// fgets(mdp, 30, stdin);
// mdp[strlen(mdp) - 1] = '\0';
// fwrite(mdp, sizeof(char), strlen(mdp) + 1, flot);
// fprintf(flot, "\n");
// fclose(flot);
// }
}

@ -38,11 +38,11 @@ bhlkbyciwrhlfivkebdd
12.00 14.00 10.00 11.00
5
Clermont-Ferrand
Informatique
0
Mécanique
1
0
Clermont-Ferrand
Biologie
Orthophonie
0
0
Clermont-Ferrand
@ -50,12 +50,12 @@ Physique
0
0
Clermont-Ferrand
Orthophonie
Biologie
0
0
Clermont-Ferrand
Mécanique
1
Informatique
0
0
6
Fixfgiwdofvbifycdlcz

@ -49,19 +49,6 @@ void menu(VilleIUT *tiut[], int *nbIUT, Etudiant *tetud[], int *nbCandidats, boo
switch (choix)
{
case 1:
// strcpy(MdPAdmin, chargerMdPAdmin());
// printf("Veuillez entrer le mot de passe administrateur :\n> ");
// while(mdp != MdPAdmin)
// {
// if(pasMdP == 3)
// {
// printf("Vous avez entré 3 fois le mauvais mot de passe, veuillez réessayer plus tard.\n");
// return;
// }
// printf("Veuillez entrer le mot de passe administrateur :\n> ");
// scanf("%s%*c", mdp);
// pasMdP++;
// }
menuAdministrateur(tiut, nbIUT, tetud, nbCandidats, phaseCandidatures, phaseTraitement);
break;
case 2:

@ -138,9 +138,6 @@ void statueCandidat(Etudiant *tetud[], int nbCandidats, Etudiant *tetudAdmis[],
*nbEtudAttente++;
}
}
afficherCandidats(tetudAdmis, *nbEtudAdmis);
printf("------------------------\n");
afficherCandidats(tetudAttente, *nbEtudAttente);
}
/**

Loading…
Cancel
Save