changes
This commit is contained in:
		
							parent
							
								
									81c62f892d
								
							
						
					
					
						commit
						ad20db3995
					
				
							
								
								
									
										55
									
								
								src/ui.c
									
									
									
									
									
								
							
							
						
						
									
										55
									
								
								src/ui.c
									
									
									
									
									
								
							| @ -25,7 +25,7 @@ int main(void) | |||||||
|     Task *task = newTask(taskname, taskcreation_date, taskdeadline_date, taskpriority, taskspare); |     Task *task = newTask(taskname, taskcreation_date, taskdeadline_date, taskpriority, taskspare); | ||||||
|     if (task == NULL) { |     if (task == NULL) { | ||||||
|         printf("Fehler beim Erstellen der Aufgabe.\n"); |         printf("Fehler beim Erstellen der Aufgabe.\n"); | ||||||
|         return -1; |         return 0; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     if (list == NULL) { |     if (list == NULL) { | ||||||
| @ -48,7 +48,8 @@ int main(void) | |||||||
|             printf("Falsche Eingabe\n");}; |             printf("Falsche Eingabe\n");}; | ||||||
|         choice = 0; |         choice = 0; | ||||||
| 
 | 
 | ||||||
|         while(( choice < 1 || choice > 5)){ |         while(( choice < 1 || choice > 5)) | ||||||
|  |         { | ||||||
|             switch (choice) |             switch (choice) | ||||||
|             { |             { | ||||||
|             case 1: |             case 1: | ||||||
| @ -78,35 +79,37 @@ int main(void) | |||||||
|                     if (scanf("%d", &taskspare) != 1) { |                     if (scanf("%d", &taskspare) != 1) { | ||||||
|                         printf("Ungültige Eingabe.\n"); |                         printf("Ungültige Eingabe.\n"); | ||||||
|                         return -1; |                         return -1; | ||||||
|                 } |                     } | ||||||
|  |                     break; | ||||||
|  |                     case 2: | ||||||
|  |                         printf("Geben Sie die zur verfuegung stehende Zeit für die Fächer an: \n"); | ||||||
|  |                     scanf("%c", &taskspare); | ||||||
|                     break; |                     break; | ||||||
| 
 | 
 | ||||||
|             case 2: |                     case 3: if( task == NULL) | ||||||
|                 printf("Geben Sie die zur verfuegung stehende Zeit für die Fächer an: \n"); |                     { | ||||||
|                 scanf("%c", &taskspare); |                         printf("Die Liste ist leer"); | ||||||
|                     break; |                     } | ||||||
|  |                     else | ||||||
|  |                     { | ||||||
|  |                         llist *iterator = list; | ||||||
|  |                         while (iterator != NULL) { | ||||||
|  |                             Task *currentTask = (Task *)(iterator->data); // Cast zu Task
 | ||||||
|  |                             printf("Fach: %s, Deadline: %ld, Priorität: %d\n", | ||||||
|  |                                    currentTask->name, currentTask->deadline, currentTask->priority); | ||||||
|  |                             iterator = iterator->next; // Gehe zum nächsten Listenelement
 | ||||||
|  |                         } | ||||||
|  |                     } | ||||||
| 
 | 
 | ||||||
|             case 3: if( task == NULL){ |                     break; | ||||||
|                 printf("Die Liste ist leer"); |                     // case 4: iCAl();break;
 | ||||||
|             } |                 } | ||||||
|             else |                 while (choice !=5);{ | ||||||
|             { |                 return EXIT_SUCCESS; | ||||||
|                 llist *iterator = list; |  | ||||||
|                 while (iterator != NULL) { |  | ||||||
|                     Task *currentTask = (Task *)(iterator->data); // Cast zu Task
 |  | ||||||
|                     printf("Fach: %s, Deadline: %ld, Priorität: %d\n", |  | ||||||
|                            currentTask->name, currentTask->deadline, currentTask->priority); |  | ||||||
|                     iterator = iterator->next; // Gehe zum nächsten Listenelement
 |  | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|             break; |         } | ||||||
|            // case 4: iCAl();break;
 |     } | ||||||
|             } |  | ||||||
|         }while (choice !=5); |  | ||||||
|         return EXIT_SUCCESS; |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| } |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user