@@ -13,7 +13,7 @@ char PreemptiveMood='P'; // Preemptive Mod variable that keep A or P
13
13
14
14
// these definitions are defined for file manipulation
15
15
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
17
17
18
18
// there are three structure is defined for value manupýlation
19
19
struct node
@@ -25,7 +25,7 @@ struct node * data;
25
25
26
26
struct result
27
27
{
28
- int pid ,waiting , responce ;
28
+ int pid ,waiting ;
29
29
struct result * next ;
30
30
};
31
31
struct result * times ;
@@ -48,8 +48,8 @@ void display (struct node *data);
48
48
void displaytimes (struct result * times );
49
49
50
50
// this is main function
51
- int main (){
52
51
52
+ int main (){
53
53
54
54
Menu (); // the called function brings menu to screen
55
55
@@ -67,21 +67,21 @@ void Menu(void) // we have created this function for print out main function
67
67
while (flag == ' ' ) // we have use flag here to control while loop
68
68
{
69
69
70
- ReadData (); // the function is called for read data from input file
70
+ ReadingData (); // the function is called for reading data from input file
71
71
72
72
printf (" Main Menu\n\n" );
73
73
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" );
78
78
}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" );
81
81
}
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 = " );
85
85
86
86
scanf ("%c" , & choise );
87
87
@@ -126,36 +126,36 @@ void MethodMenu(void) // we have created this function for print out main funct
126
126
{ char flag = ' ' ;
127
127
while (flag == ' ' ) // we have use flag here to control while loop
128
128
{
129
- ReadData (); // the function is called for read data from input file
129
+ ReadingData (); // the function is called for reading data from input file
130
130
131
131
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 = " );
139
139
140
140
scanf ("%c" , & choise );
141
141
142
142
system ("cls" );
143
143
144
144
145
145
if (choise == '1' ){
146
- printf ("1) First Come First Served Scheduling\n" );
146
+ printf ("1- ) First Come First Served Scheduling\n" );
147
147
break ;
148
148
}if (choise == '2' ){
149
- printf ("2) Shortest Job First Scheduling\n" );
149
+ printf ("2- ) Shortest Job First Scheduling\n" );
150
150
break ;
151
151
}if (choise == '3' ){
152
- printf ("3) Priority Scheduling\n" );
152
+ printf ("3- ) Priority Scheduling\n" );
153
153
break ;
154
154
}if (choise == '4' ){
155
- printf ("4) Roui nd Robin Scheduling\n" );
155
+ printf ("4-) Round Robin Scheduling\n" );
156
156
break ;
157
157
}if (choise == '5' ){
158
- printf ("5) Back to Main Menu\n" );
158
+ printf ("5- ) Back to Main Menu\n" );
159
159
Menu ();
160
160
break ;
161
161
}if (choise == '6' ){
@@ -174,8 +174,8 @@ void MethodMenu(void) // we have created this function for print out main funct
174
174
while (choise != '6' );
175
175
}
176
176
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 )
179
179
{
180
180
181
181
@@ -199,7 +199,7 @@ void ReadData(void)
199
199
{
200
200
row ++ ;
201
201
sscanf (line ,"%d:%d:%d\n" ,& b ,& a ,& p );
202
- // push data to likend list
202
+ // push data to linked list
203
203
data = insertBack (data ,b ,a ,p ,row );
204
204
// print to screen
205
205
printf ("%u) %u %u %u\n" ,row ,b ,a ,p );
@@ -208,8 +208,8 @@ void ReadData(void)
208
208
209
209
fclose (fp );
210
210
211
- printf (" Input file readed succesfully.\n" );
212
- printf ( " Processing...\n\n" );
211
+ printf (" Input file readed succesfully.\n\n " );
212
+
213
213
214
214
}
215
215
@@ -229,7 +229,7 @@ struct result * initializeresult(struct result * times)
229
229
times = (struct result * )malloc (sizeof (struct result * ));
230
230
times -> pid = 0 ;
231
231
times -> waiting = 0 ;
232
- times -> responce = 0 ;
232
+
233
233
234
234
return times ;
235
235
}
0 commit comments