Mini Projet en Langage C

kol_mikaelson Messages postés 2 Statut Membre -  
[Dal] Messages postés 6122 Date d'inscription   Statut Contributeur Dernière intervention   -
Bonjour,

j'ai un problème concernant un Mini projet en Langage C, j'arrive pas a terminé le programme, car je suis débutant en programmation
et j'espère que vous me donnez un coup de main

voici Le Mini Projet :)

GESTION d'UNE BANQUE

Soit les 2 structures suivantes :

* « Client » il contient les informations sur les clients.
o Id _client: entier.
o nom : chaîne de caractères.
o prénom : chaîne de caractères.
o profession : chaîne de caractères.
o Num_tel: chaîne de caractères.
o Date d'ouverture.
o Profession.

* « compte » il contient les informations sur les comptes des clients.
o Id_compte : entier.
o Id_client : entier.
o Solde de base : réel.
Travail à faire :

Réaliser les programmes menus suivants :

1. MENU GENERAL.

MENU GENERAL
A. Gestion des clients
B. Gestion des comptes
C. Gestion des opérations
D. Quitter
Id_client :
Nom :
Prenom :
Profession :
Num_tel :
Retour

Nom :
Prenom :
Profession :
Num_tel :
Retour
2. MENU GESTION DES CLIENTS

MENU GESTION DES CLIENTS

1. Ajout client
2. Modification
3. Suppression
4. Recherche
5. MENU GENERAL
supression se fait ==> 1.Un par un
2.Tout

la recherche se fait a partir de==> 1. Par id_client
2. Par nom

Id_compte : nouveau compte se fait a partir de id client et idcompte!
Id_client :
Solde de base :
Date d'ouverture :

3. MENU GESTION DES Comptes :

MENU GESTION DES COMPTES
1. Nouveau compte
2. Consultation
3. Fermeture du compte
4. MENU GENERAL

et ça c'est un tableau que l'on doit afficher!
Id_client :
Id_compte| Nom & Prénom| Solde de base| Opérations effectuées/date
|
-
-
-
-

4. MENU GESTION DES OPERATIONS :
Id_compte :
Id_client :
Montant retiré :

MENU GESTION DES OPEARTIONS
1 .Retrait
2. Virement
3. MENU GENERAL

Id_compte :
Id_client :
Montant versé : le virement se fait à partir de ces 3 donnés

« Gestion des clients »

1) On ne peut pas ajouter un client qui existe déjà.
2) la Modification et la Suppression se font par id_client.
3) La suppression doit être confirmé (Supprimer O/N ?).

« Gestion des comptes»

1) On ne peut pas ajouter un compte qui existe déjà.
2) Un client peut avoir plusieurs comptes.
3) la fermeture du compte se fait par id_compte.
4) La suppression doit être confirmer (Supprimer O/N ?).
5) Le solde de base doit être supérieur à 1000DH.

« Gestion des opérations»

6) Le retrait ne doit pas dépasser 700 DH.

3 réponses

  1. kol_mikaelson Messages postés 2 Statut Membre 8
     
    #include <stdio.h>
    #include <stdlib.h>
    #include <conio.h>
    #include <string.h>
    #include <time.h>

    void Menu();
    void Gestion_des_clients();
    void Ajout_client();
    void Modification();
    int Recherche();

    typedef struct{
    int *id_client;
    char nom[30];
    char prenom[30];
    char profession[30];
    char num_tel[30];
    }client;

    // ***************** MENU PRINCIPAL ******************** //

    void Menu()
    {
    int choix;
    clrscr();
    printf(" ******MENU PRINCIPAL****** ");
    gotoxy(15,8); printf("1. Gestion des Clients\n");
    gotoxy(15,10);printf("2. Gesion des comptes");
    gotoxy(15,12);printf("3. Gestion des opérations");
    gotoxy(15,14);printf("4. Quitter");

    printf("\n\n\n Tapez votre choix : "); scanf("%d",&choix);

    switch(choix){
    do{
    case 1:
    Gestion_des_clients();
    break;

    case 2:
    printf("Gesion des comptes");
    // Gesion_des_comptes();
    break;

    case 3:
    printf("Gestion des opérations");
    // Gestion_des_operations();
    break;

    case 4:
    printf("Quitter");
    // Quitter();
    break;
    default : printf("le choix est incorrect ! ");
    break;

    }while(choix!=0);

    }
    }

    // ***************** MENU GESTION DES CLIENTS ********************** //

    void Gestion_des_clients()
    {
    int choix;
    clrscr();

    printf("******MENU GESTION DES CLIENTS******");
    gotoxy(15,8); printf("1. Ajout Client\n");
    gotoxy(15,10);printf("2. Modification");
    gotoxy(15,12);printf("3. Suppression");
    gotoxy(15,14);printf("4. Recherche");
    gotoxy(15,16);printf("5. Menu Principal");

    printf("\n\n\n Tapez votre choix : "); scanf("%d",&choix);

    switch(choix){
    do{
    case 1:
    Ajout_client();
    break;

    case 2:
    Modification();
    break;

    case 3:
    printf("Suppression");
    // Suppression();
    break;

    case 4:
    Recherche();
    break;

    case 5:
    Menu();
    break;

    default : printf("le choix est incorrect ! ");

    }while(choix!=5);

    }
    }

    // *************** AJOUTER UN CLIENT ******************** //

    void Ajout_client(client *T,int *n)
    {
    {
    printf("Entrez l'identifiant du client : "); scanf("%d",&T[n].id_client);
    fflush(stdin);
    printf("Entrez le Nom du client : "); gets(T[n].nom);
    fflush(stdin);
    printf("Entrez le Prenom du client : "); gets(T[n].prenom);
    fflush(stdin);
    printf("Entrez la Profession du client : "); gets(T[n].profession);
    fflush(stdin);
    printf("Entrez la Num Tel du client : "); gets(T[n].num_tel);
    }

    n++;

    Gestion_des_clients();
    }

    // **************** RECHERCHE UN CLIENT **************** //

    int Recherche(client T[],int N,int x)
    {
    int i;

    for(i=0;i<N;i++)

    if(T[i].id_client==x)
    return i;

    return -1;

    }

    // ***************** MODIFIER UN CLIENT ****************** //

    void Modification(client T[],int N)
    {
    int pos,x;
    printf("entrez l'id client ! "); scanf("%d",&x);
    pos=Recherche(T,N,x);
    if(pos==-1)
    printf("ID client incorrect !");
    else
    {
    printf("Entrez Le Nom : "); fflush(stdin); gets(T[pos].nom);
    printf("Entrez Le Prenom : "); fflush(stdin); gets(T[pos].prenom);
    printf("Entrez La Profession : "); fflush(stdin); gets(T[pos].profession);
    printf("Entrez Le Num Tel : "); fflush(stdin); gets(T[pos].num_tel);
    }

    }

    ********************************************************

    jusqu'à maintenant la seule Fonction qui marche bien c'est L'ajout :D

    Les autres Fonctions se manque de quelque chose

    merci de votre attention .. !
    8