Browse Source

added round 8 function and header to epic game

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

32
src/main/quizproject.c

@ -1255,6 +1255,37 @@ if (strcmp(answer, "a") == 0) {
return score; return score;
} }
int B_round8(void) {
int score = 0;
char answer[20];
printf("Round 8\n");
printf("Question 1: Who played the lead role in the movie 'The Godfather'?\n");
printf("Options: a.)Marlon Brando b.)Robert De Niro c.)Al Pacino d.)Jack Nicholson");
printf("Answer: ");
scanf("%s", answer);
if (strcmp(answer, "a") == 0) {
printf("Correct!\n");
score++;
} else {
printf("Incorrect. The answer is a.\n");
}
printf("Question 2: Who wrote the play 'Hamlet'?\n");
printf("Options: a.)William Shakespeare b.)Christopher Marlowe c.)Ben Jonson d.)John Milton");
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() { void b_epic_game() {
B_displayWelcomeMessage(); B_displayWelcomeMessage();
b_entertostart(); b_entertostart();
@ -1271,6 +1302,7 @@ void b_epic_game() {
total_score += B_round5(); total_score += B_round5();
total_score += B_round6(); total_score += B_round6();
total_score += B_round7(); total_score += B_round7();
total_score += B_round8();
} }

1
src/main/quizproject.h

@ -61,6 +61,7 @@ int B_round4(void);
int B_round5(void); int B_round5(void);
int B_round6(void); int B_round6(void);
int B_round7(void); int B_round7(void);
int B_round8(void);
#define NUM_QUESTIONS 5 #define NUM_QUESTIONS 5
#define round 15 #define round 15

Loading…
Cancel
Save