Browse Source

added round 6 function and header to epic game

main
fdlt3885 2 years ago
parent
commit
485091962a
  1. 32
      src/main/quizproject.c
  2. 1
      src/main/quizproject.h

32
src/main/quizproject.c

@ -1193,6 +1193,37 @@ int B_round5(void) {
return score;
}
int B_round6(void) {
int score = 0;
char answer[20];
printf("Round 6\n");
printf("Question 1: Who wrote the novel 'To Kill a Mockingbird'?\n");
printf("Options: a.)Jane Austen b.)Agatha Christie c.)Harper Lee d.)Mary Shelley");
printf("Answer: ");
scanf("%s", answer);
if (strcmp(answer, "c") == 0) {
printf("Correct!\n");
score++;
} else {
printf("Incorrect. The answer is c.\n");
}
printf("Question 2: Who painted the famous artwork 'The Starry Night'?\n");
printf("Options: a.)Vincent van Gogh b.)Pablo Picasso c.)Leonardo da Vinci d.)Rembrandt");
printf("Answer: ");
scanf("%s", answer);
if (strcmp(answer, "a") == 0) {
printf("Correct!\n");
score++;
} else {
printf("Incorrect. The answer is a.\n");
}
return score;
}
void b_epic_game() {
B_displayWelcomeMessage();
b_entertostart();
@ -1207,6 +1238,7 @@ void b_epic_game() {
total_score += B_round3();
total_score += B_round4();
total_score += B_round5();
total_score += B_round6();
}

1
src/main/quizproject.h

@ -59,6 +59,7 @@ int B_round2(void);
int B_round3(void);
int B_round4(void);
int B_round5(void);
int B_round6(void);
#define NUM_QUESTIONS 5
#define round 15

Loading…
Cancel
Save