-
Notifications
You must be signed in to change notification settings - Fork 0
/
coffee.c
94 lines (73 loc) · 1.21 KB
/
coffee.c
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
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
// Exercice: machine a cafe
// ========================
// Distributeur de boissons chaude
// =>
#define MINV DIX_CENT
typedef struct boisson_chaude cafe;
struct boissson_chaude
{
int eau;
int sucre;
int cafe;
};
typedef enum pieces_euro pieces;
enum pieces_euro
{
DIX_CENT,
VINGT_CENT,
TRENTE_CENT,
QUARANTE_CENT,
CINQUANTE_CENT,
SOIXANTE_CENT,
CINQ_EURO
};
typedef enum prix_boisson prix_cafe;
enum prix_boisson
{
EXPRESSO = TRENTE_CENT,
CAFE_COURT = QUARANTE_CENT,
CAFE_LONG = CINQUANTE_CENT,
CAFE_LATE = SOIXANTE_CENT
};
// Prototypes - functions
// ======================
//
void menu(char* msg)
{
puts(msg);
}
int selection(prix_cafe price)
{
switch(price)
{
case EXPRESSO: { break; }
case CAFE_COURT: { break; }
case CAFE_LONG: { break; }
case CAFE_LATE: { break; }
// default {}
}
}
int payement2(int somme)
{
switch(somme)
{
case 10: { break; }
case 20: { break; }
case 50: { break; }
case 100: { break; }
case 200: { break; }
case 500: { break; }
// default {}
}
}
// main
// ================
// Entree du programme | arguments => 0 | retourne 0
int main(void)
{
puts("machine a cafe !");
return 0;
}