Créer un programme de gestion de contacts
Simedabdou
Messages postés
1
Date d'inscription
Statut
Membre
Dernière intervention
-
juliencolin54 Messages postés 217 Date d'inscription Statut Membre Dernière intervention -
juliencolin54 Messages postés 217 Date d'inscription Statut Membre Dernière intervention -
Bonjour tout le monde j'ai vraiment besoin de votre aide pour mon mini projet
si vous avez la possibilité de m'offrir votre aide j'en serais très reconnaissant je vous remercie d'avance
mon mini projet consiste a créer un programme en Langage C qui permet de faire la gestion des contacts et il doit contenir ce menu
1- ajout d'un contact
2- recherche Contact
3- modifier contact
4- suppression contact
j'ai déjà débuter dans ce programme
voici le début de mon programme
Merci pour votre aide
#include<stdio.h>
#include<conio.h>
#include<string.h>
#include <windows.h>
struct Date
{
int jour;
int mois;
int annee;
}Date;
struct Adresse
{
char Ville[10];
char Quartier[10];
int immeuble;
}Adresse;
struct Contact
{int idcontact;
char nom[10];
char prenom[10];
char Email[50];
int Numero;
}Contact;
struct Contact t[500];
int i;
void saisie()
{
printf("taper votre Id:" );
scanf("%d",&t[i].idcontact);
printf("taper nom:" );
scanf("%s",&t[i].nom);
printf("taper prenom:" );
scanf("%s",&t[i].prenom);
printf("entrer votre date de naissance:" );
scanf("%d %d %d",&Date.jour,&Date.mois,&Date.annee);
printf("Donner votre numero de Telephone\t");
scanf("%d",&t[i].Numero);
printf("taper L'Email:" );
scanf("%s",&t[i].Email);
printf("donner votre Adresse\n");
scanf("%s %s %s",&Adresse.Ville,&Adresse.Quartier,&Adresse.immeuble);
}
void recherche()
{
char x[10];
int i;
printf("donner le nom du contact que vous chercher\n");
scanf("%s",x);
for(i=0;i<100;i++)
{
if(x==t[i].nom)
{
printf("Son Id est : %d\n",t[i].idcontact);
printf("Son prenom est : \t %s\n",t[i].prenom);
printf(" Email : %s\n",t[i].Email);
printf("Numero de Telephone : %d\n",t[i].Numero);
printf("Adresse : %s . %s . %s ",Adresse.immeuble,Adresse.Quartier,Adresse.Ville);
i=100;
}
}
}
int menu1()
{
int choix;
printf("\t\t\t\t MENU PRINCIPALE \n");
printf(" 1-Gestion des contacts \n");
printf(" 2-Quitter \n");
printf(" Choix: \n");
scanf("%d",&choix);
return choix;
}
void mod()
{
int choix,d,cpt,j;
char x[10];
do{
printf("Pour modifier un contact tapez le nom(Tapez 1 puis le nom ) ou le num%cro(tapez 2 puis le num%cro) pour modifier");
scanf("%d",&choix);
if(choix!=1 || choix!=2)
{
printf("Veuillez tapez 1 : Pour tapez nom \n Ou bien tapez 2 : pour tapez num%cro");
scanf("%d",&choix);
}
}while(choix!=1 && choix!=2);
switch (choix)
{
case 1 : scanf(" %s",x);
for(cpt=0;cpt<i;cpt++)
{
if (t[i].nom==x)
{
d=cpt;
j=1;
}
}
if(j==1)
{
printf("Le nom %c existe , modification possible : ");
system("cls");
printf("\n\t\t\tNom:");
scanf(" %s",&t[d].nom);
printf("\n\t\t\tEmail:");
scanf(" %s",&t[d].Email);
printf("\n\t\t\tNumero:");
scanf(" %d",&t[d].Numero);
printf("\n\t\t\tdate de naissane:");
printf("\n\t\t\t\tjour:");
scanf(" %d",&Date.jour);
printf("\n\t\t\t\tMois:");
scanf(" %d",&Date.mois);
printf("\n\t\t\t\t annee:");
scanf(" %d",&Date.annee);
printf("\n\t\t\tAdresse:");
scanf(" %s %s %s",&Adresse.Ville,&Adresse.Quartier,&Adresse.immeuble);
}
else
printf("\n\t\t\t\a\a\aCe nom n'existe pas veuillez ressaiez ");
}
}
int main()
{
int choix1,x;
x = menu1();
if(x==2)
exit(1);
else if(x==1)
{
do
{
printf("\nMenu:\n");
printf(" 1-Ajout D'un Contact\n");
printf(" 2-chercher Un Contact\n");
printf(" 3-Modification \n");
printf(" 4-Suppression \n");
printf(" 5-quitter le programme\n");
printf(" |Votre choix| : ");
scanf("%d", &choix1);
switch (choix1)
{
case 1 : saisie();
break;
case 2 : recherche();
break;
case 3 : mod();
default : break;
}
} while(choix1 != 5);
}
getch();
return 0;
}
si vous avez la possibilité de m'offrir votre aide j'en serais très reconnaissant je vous remercie d'avance
mon mini projet consiste a créer un programme en Langage C qui permet de faire la gestion des contacts et il doit contenir ce menu
1- ajout d'un contact
2- recherche Contact
3- modifier contact
4- suppression contact
j'ai déjà débuter dans ce programme
voici le début de mon programme
Merci pour votre aide
#include<stdio.h>
#include<conio.h>
#include<string.h>
#include <windows.h>
struct Date
{
int jour;
int mois;
int annee;
}Date;
struct Adresse
{
char Ville[10];
char Quartier[10];
int immeuble;
}Adresse;
struct Contact
{int idcontact;
char nom[10];
char prenom[10];
char Email[50];
int Numero;
}Contact;
struct Contact t[500];
int i;
void saisie()
{
printf("taper votre Id:" );
scanf("%d",&t[i].idcontact);
printf("taper nom:" );
scanf("%s",&t[i].nom);
printf("taper prenom:" );
scanf("%s",&t[i].prenom);
printf("entrer votre date de naissance:" );
scanf("%d %d %d",&Date.jour,&Date.mois,&Date.annee);
printf("Donner votre numero de Telephone\t");
scanf("%d",&t[i].Numero);
printf("taper L'Email:" );
scanf("%s",&t[i].Email);
printf("donner votre Adresse\n");
scanf("%s %s %s",&Adresse.Ville,&Adresse.Quartier,&Adresse.immeuble);
}
void recherche()
{
char x[10];
int i;
printf("donner le nom du contact que vous chercher\n");
scanf("%s",x);
for(i=0;i<100;i++)
{
if(x==t[i].nom)
{
printf("Son Id est : %d\n",t[i].idcontact);
printf("Son prenom est : \t %s\n",t[i].prenom);
printf(" Email : %s\n",t[i].Email);
printf("Numero de Telephone : %d\n",t[i].Numero);
printf("Adresse : %s . %s . %s ",Adresse.immeuble,Adresse.Quartier,Adresse.Ville);
i=100;
}
}
}
int menu1()
{
int choix;
printf("\t\t\t\t MENU PRINCIPALE \n");
printf(" 1-Gestion des contacts \n");
printf(" 2-Quitter \n");
printf(" Choix: \n");
scanf("%d",&choix);
return choix;
}
void mod()
{
int choix,d,cpt,j;
char x[10];
do{
printf("Pour modifier un contact tapez le nom(Tapez 1 puis le nom ) ou le num%cro(tapez 2 puis le num%cro) pour modifier");
scanf("%d",&choix);
if(choix!=1 || choix!=2)
{
printf("Veuillez tapez 1 : Pour tapez nom \n Ou bien tapez 2 : pour tapez num%cro");
scanf("%d",&choix);
}
}while(choix!=1 && choix!=2);
switch (choix)
{
case 1 : scanf(" %s",x);
for(cpt=0;cpt<i;cpt++)
{
if (t[i].nom==x)
{
d=cpt;
j=1;
}
}
if(j==1)
{
printf("Le nom %c existe , modification possible : ");
system("cls");
printf("\n\t\t\tNom:");
scanf(" %s",&t[d].nom);
printf("\n\t\t\tEmail:");
scanf(" %s",&t[d].Email);
printf("\n\t\t\tNumero:");
scanf(" %d",&t[d].Numero);
printf("\n\t\t\tdate de naissane:");
printf("\n\t\t\t\tjour:");
scanf(" %d",&Date.jour);
printf("\n\t\t\t\tMois:");
scanf(" %d",&Date.mois);
printf("\n\t\t\t\t annee:");
scanf(" %d",&Date.annee);
printf("\n\t\t\tAdresse:");
scanf(" %s %s %s",&Adresse.Ville,&Adresse.Quartier,&Adresse.immeuble);
}
else
printf("\n\t\t\t\a\a\aCe nom n'existe pas veuillez ressaiez ");
}
}
int main()
{
int choix1,x;
x = menu1();
if(x==2)
exit(1);
else if(x==1)
{
do
{
printf("\nMenu:\n");
printf(" 1-Ajout D'un Contact\n");
printf(" 2-chercher Un Contact\n");
printf(" 3-Modification \n");
printf(" 4-Suppression \n");
printf(" 5-quitter le programme\n");
printf(" |Votre choix| : ");
scanf("%d", &choix1);
switch (choix1)
{
case 1 : saisie();
break;
case 2 : recherche();
break;
case 3 : mod();
default : break;
}
} while(choix1 != 5);
}
getch();
return 0;
}
A voir également:
- Créer un programme de gestion de contacts
- Créer un compte google - Guide
- Comment créer un groupe whatsapp - Guide
- Créer un lien pour partager des photos - Guide
- Créer un compte gmail - Guide
- Créer un compte instagram sur google - Guide