1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156
| #include <stdlib.h>
#include <stdio.h>
#define hotel2etoil 1
#define hotel3etoil 2
#define aucunhotel 3
#define p1person 4
#define p2person 5
#define dejeuner 6
#define diner 7
#define dejeuneetdiner 8
#define aucunrepas 9
// creation de types
typedef struct participant Participant;
struct participant
{
char nom[20];
char prenom[30];
unsigned int nbreclient;
unsigned int hotel;
unsigned int repas;
};
struct participant tab[100];
/*typedef struct tabpart TabPart;
struct tabpart
{
Participant tab[100];
};*/
// variables globales
Participant*ptr;
//fonctions
void choixhotel(unsigned int hotel )
{
int i;
printf("Quelle hotel choisissez vous?");
printf("1=hotel2etoile\t 2=hotel3etoile\t 3=aucunhotel");
scanf("%d",&i);
switch(i)
{
case hotel2etoil : system(cls);
hotel=75;
print("hotel 2etoile");
system(cls);
break;
case hotel3etoil : system(cls);
hotel=100;
printf("hotel 3etoile");
system(cls);
break;
case aucunhotel : system(cls);
hotel=0;
printf("aucun hotel");
system(cls);
break;
}
}
void choixrepas(unsigned int repas,unsigned int nbreclient )
{
int p,r;
printf("nobre de personne");
scanf("%d",&p);
switch(p)
{
case p1person : system(cls);
nbreclient=1;
printf("1 personne");
system(cls);
break;
case p2person : system(cls);
nbreclient=2;
printf("2 personnes");
system(cls);
break;
}
printf("quelle repas desirez vous ");
printf(" dejeune\n diner\n dejeune et diner \n aucun\n");
scanf("%d",&r);
switch(r)
{
case dejeuner : system(cls);
if (p==2)
{
repas=2*15;
}
else
{
repas=15;
}
print("dejeune");
system(cls);
break;
case diner : system(cls);
if (p==2)
{
repas=2*75;
}
else
{
repas=75;
}
print("diner");
system(cls);
break;
case dejeuneetdiner : system(cls);
if (p==2)
{
repas=2*(15+75);
}
else
{
repas=(15+75);
}
print("dejeune et diner");
system(cls);
break;
case aucunrepas : system(cls);
repas=0;
printf("aucun repas");
system(cls);
break;
}
}
ĵNb2Etoiles
Nb3Etoiles
int calculMontant( unsigned int hotel,unsigned int repas)
{
return hotel+repas;
}
/*void interface0()
{
printf("1=inscription");
printf("2=informations");
}
void interfaceinscription()
{
printf("3=reservation hotel");
printf("4=reservation repas");
}
void interfaceinfos()
{
printf("5=afficher info client2*");
printf("6=afficher info client3*");
printf("7=afficher info repas");
printf("8=montant conso");
}
int main()
{
printf("Bienvenu dans le menu des reservations");
free();
return 0;
}*/ |
Partager