-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCustomerSatisfaction.c
103 lines (85 loc) · 2.18 KB
/
CustomerSatisfaction.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
95
96
97
98
99
100
101
102
103
#include<stdio.h>
#include<conio.h>
#include <unistd.h>
#include<windows.h>
int main(){
int choice;
int food,cleanliness,ambience,service,problem;
int avg;
int i;
FILE *fp;
// textcolor(1);
COORD c = {0, 0};
void setxy (int x, int y)
{
c.X = x; c.Y = y; // Set X and Y coordinates
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), c);
}
//over
printf("\t\t\t\t\t");
for(i=0;i<10;i++)
{
system("color B");
printf("**");
}
a:
printf("\n\t\t\t\t\t MAIN MENU \n");
printf("\t\t\t\t\t");
for(i=0;i<10;i++)
{
system("color B");
printf("**");
}
printf("\nEnter\n1. To give ratings\n2. Have any problem?\n");
scanf("%d",&choice);
if(choice==1)
{
fp=fopen("CustomerSatisfaction.txt","a+");
printf("You can give ratings from 1 to 5\nwhere 1 is: Very Bad and 5:Very Good\n");
printf("Ambience:");
fscanf(stdin," %d",&ambience);
printf("Service:");
fscanf(stdin," %d",&service);
printf("Food:");
fscanf(stdin," %d",&food);
printf("Cleanliness:");
fscanf(stdin," %d",&cleanliness);
avg=(ambience+service+food+cleanliness)/4;
fprintf(fp,"\n%d %d %d %d",ambience,service,food,cleanliness);
//printing moving output
for(i=0; i<35; i++)
{
system("color B");
setxy(i, 15);
printf(" THANKYOU FOR YOUR FEEDBACK : )");
setxy(i-3, 15); //For clearing previous position of arrow
Sleep(100);
}
fclose(fp);
fp=fopen("review_avg.txt","a");
fprintf(fp,"%d\n",avg);
fclose(fp);
}
else if(choice==2)
{
printf("Choose your problem:\nEnter:\n1.Room cleaning\n2.Electricty\n3.Water\n4.Wifi connection issue\n");
scanf("%d",&problem);
printf("\nThankyou for letting us know.\nWe will be solving your issue as soon as possible.\n");
sleep(3);
for(i=0; i<35; i++)
{
system("color B1");
setxy(i, 18);
printf(" Your problem is being solved : )");
setxy(i-1, 18);
Sleep(100);
}
}
else
{
printf("Please enter valid input");
goto a;
}
getch();
return 0;
}