Skip to content

Commit f351384

Browse files
author
Fatih
committed
simple changes to codes
1 parent 69fafe0 commit f351384

File tree

1 file changed

+32
-32
lines changed

1 file changed

+32
-32
lines changed

schedularsimulator.c

+32-32
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ char PreemptiveMood='P'; // Preemptive Mod variable that keep A or P
1313

1414
// these definitions are defined for file manipulation
1515
char *inputfile="input.txt"; //input source
16-
void ReadData(void); // the function defined function reads data from the input source
16+
void ReadingData(void); // the function defined function reading data from the input source
1717

1818
// there are three structure is defined for value manupýlation
1919
struct node
@@ -25,7 +25,7 @@ struct node * data;
2525

2626
struct result
2727
{
28-
int pid,waiting,responce;
28+
int pid,waiting;
2929
struct result *next;
3030
};
3131
struct result * times;
@@ -48,8 +48,8 @@ void display (struct node *data);
4848
void displaytimes (struct result *times);
4949

5050
// this is main function
51-
int main(){
5251

52+
int main(){
5353

5454
Menu(); // the called function brings menu to screen
5555

@@ -67,21 +67,21 @@ void Menu(void) // we have created this function for print out main function
6767
while(flag==' ') // we have use flag here to control while loop
6868
{
6969

70-
ReadData(); // the function is called for read data from input file
70+
ReadingData(); // the function is called for reading data from input file
7171

7272
printf(" Main Menu\n\n");
7373
printf(" Please, Choose Your Option\n");
74-
printf("1) Scheduling Method\n");
75-
if (PreemptiveMood=='A'){
76-
printf("2) Preemptive Mode (enable)\n" );
77-
printf("3) Non-preemptive Mode\n");
74+
printf("1-) Scheduling Method\n");
75+
if (PreemptiveMood=='A'){ //this function specifies which mode is active
76+
printf("2-) Preemptive Mode (enable)\n" );
77+
printf("3-) Non-preemptive Mode\n");
7878
}else{
79-
printf("2) Preemptive Mode\n" );
80-
printf("3) Non-preemptive Mode (enable)\n");
79+
printf("2-) Preemptive Mode\n" );
80+
printf("3-) Non-preemptive Mode (enable)\n");
8181
}
82-
printf("4) Show Result\n");
83-
printf("5) End Program\n");
84-
printf("Option >");
82+
printf("4-) Show Result\n");
83+
printf("5-) End Program\n");
84+
printf("Option =");
8585

8686
scanf("%c", &choise);
8787

@@ -126,36 +126,36 @@ void MethodMenu(void) // we have created this function for print out main funct
126126
{ char flag=' ';
127127
while(flag==' ') // we have use flag here to control while loop
128128
{
129-
ReadData(); // the function is called for read data from input file
129+
ReadingData(); // the function is called for reading data from input file
130130

131131
printf(" Scheduling Method Menu\n\n");
132-
printf("1) First Come First Served Scheduling\n");
133-
printf("2) Shortest Job First Scheduling\n");
134-
printf("3) Priority Scheduling\n");
135-
printf("4) Round Robin Scheduling\n");
136-
printf("5) Back to Main Menu\n");
137-
printf("6) End Program\n");
138-
printf("Option >");
132+
printf("1-) First Come First Served Scheduling\n");
133+
printf("2-) Shortest Job First Scheduling\n");
134+
printf("3-) Priority Scheduling\n");
135+
printf("4-) Round Robin Scheduling\n");
136+
printf("5-) Back to Main Menu\n");
137+
printf("6-) End Program\n");
138+
printf("Option =");
139139

140140
scanf("%c", &choise);
141141

142142
system("cls");
143143

144144

145145
if(choise == '1'){
146-
printf("1) First Come First Served Scheduling\n");
146+
printf("1-) First Come First Served Scheduling\n");
147147
break;
148148
}if(choise == '2'){
149-
printf("2) Shortest Job First Scheduling\n");
149+
printf("2-) Shortest Job First Scheduling\n");
150150
break;
151151
}if(choise == '3'){
152-
printf("3) Priority Scheduling\n");
152+
printf("3-) Priority Scheduling\n");
153153
break;
154154
}if(choise == '4'){
155-
printf("4) Roui nd Robin Scheduling\n");
155+
printf("4-) Round Robin Scheduling\n");
156156
break;
157157
}if(choise == '5'){
158-
printf("5) Back to Main Menu\n");
158+
printf("5-) Back to Main Menu\n");
159159
Menu();
160160
break;
161161
}if(choise == '6'){
@@ -174,8 +174,8 @@ void MethodMenu(void) // we have created this function for print out main funct
174174
while(choise!='6');
175175
}
176176

177-
// this function is wrote for that read data from input file
178-
void ReadData(void)
177+
// this function is wrote for that reading data from input file
178+
void ReadingData(void)
179179
{
180180

181181

@@ -199,7 +199,7 @@ void ReadData(void)
199199
{
200200
row++;
201201
sscanf(line,"%d:%d:%d\n",&b,&a,&p);
202-
// push data to likend list
202+
// push data to linked list
203203
data=insertBack(data,b,a,p,row);
204204
// print to screen
205205
printf("%u) %u %u %u\n",row,b,a,p);
@@ -208,8 +208,8 @@ void ReadData(void)
208208

209209
fclose(fp);
210210

211-
printf(" Input file readed succesfully.\n");
212-
printf(" Processing...\n\n");
211+
printf(" Input file readed succesfully.\n\n");
212+
213213

214214
}
215215

@@ -229,7 +229,7 @@ struct result * initializeresult(struct result * times)
229229
times=(struct result*)malloc(sizeof(struct result*));
230230
times->pid=0;
231231
times->waiting=0;
232-
times->responce=0;
232+
233233

234234
return times;
235235
}

0 commit comments

Comments
 (0)