-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCode1_1000768238.c
More file actions
76 lines (61 loc) · 1.33 KB
/
Code1_1000768238.c
File metadata and controls
76 lines (61 loc) · 1.33 KB
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
/* Donald Adams 100 076 8238 */
#include <stdio.h>
#define YES 1
#define NO 0
int main (void)
{
int Decision;
system("clear");
printf("Enter 1 for YES and 0 for NO\n\n");
printf("You are ordering from the McDonalds Menu at the Drive Thru\n\n");
printf("Would you like a burger?");
scanf("%d", &Decision);
if (Decision == YES)
{
printf("\n\nDid you want fries with that?\n\n");
scanf("%d", &Decision);
if (Decision == YES)
{
/* Yes Yes (1 1) */
printf("Big Mac with Fries!!\n\n");
}
else if (Decision == 0)
{
/* Yes No (1 0) */
printf("McDouble!!\n");
}
}
else if (Decision == NO)
{
/* No (0) */
printf("\n\nDo you want a chicken sandwich? ");
scanf("%d", &Decision);
if (Decision == NO)
{
/* No No (0 0) */
printf("\n\nDo you want a Salad? ");
scanf("%d", &Decision);
if (Decision == YES)
{
/* No No Yes (0 0 1) */
printf("\n\nSouthwest Grilled Chicken Salad!!\n\n");
}
else
{
/* No No No (0 0 0) */
printf("\n\nIce Cream Cone!!\n\n");
}
}
else
{
/* No Yes (0 1) */
printf("\n\nClassic Chicken Sandwich\n\n");
}
}
else
{
printf("\n\n%d is not a valid input - "
"enter 0 for NO or 1 for YES.\n", Decision);
}
return 0;
}