Browse Source

Funktion für ungültige Eingabe Struktur

remotes/origin/Pascal
Pascal Schneider 11 months ago
parent
commit
ac5c8ea117
  1. 5
      src/timequiz.c
  2. 1
      src/timequiz.h

5
src/timequiz.c

@ -12,6 +12,8 @@ void displayQuestion(char* question, char* answers[], int correctIndex);
void processUserAnswer(int userAnswer, int correctIndex, int* score, int* totalCorrectAnswers, char* answers[]); void processUserAnswer(int userAnswer, int correctIndex, int* score, int* totalCorrectAnswers, char* answers[]);
int isValidAnswer(int userAnswer);
void timequiz() { void timequiz() {
printf("Welcome to our Time Quiz!\n"); printf("Welcome to our Time Quiz!\n");
@ -187,3 +189,6 @@ void processUserAnswer(int userAnswer, int correctIndex, int* score, int* totalC
printf("Wrong! The correct answer is: %d. %s\n", correctIndex + 1, answers[correctIndex]); printf("Wrong! The correct answer is: %d. %s\n", correctIndex + 1, answers[correctIndex]);
} }
} }
int isValidAnswer(int userAnswer) {
}

1
src/timequiz.h

@ -5,5 +5,6 @@ void timequiz();
int getRandomQuestionIndex(int askedQuestions[], int totalQuestions); int getRandomQuestionIndex(int askedQuestions[], int totalQuestions);
void displayQuestion(char* question, char* answers[], int correctIndex); void displayQuestion(char* question, char* answers[], int correctIndex);
void processUserAnswer(int userAnswer, int correctIndex, int* score, int* totalCorrectAnswers, char* answers[]); void processUserAnswer(int userAnswer, int correctIndex, int* score, int* totalCorrectAnswers, char* answers[]);
int isValidAnswer(int userAnswer);
#endif //ende TIMEQUIZ_H #endif //ende TIMEQUIZ_H
Loading…
Cancel
Save