Browse Source

added round 7 function and header to epic game

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

32
src/main/quizproject.c

@ -1224,6 +1224,37 @@ if (strcmp(answer, "a") == 0) {
return score;
}
int B_round7(void) {
int score = 0;
char answer[20];
printf("Round 7\n");
printf("Question 1: Who directed the movie 'The Shawshank Redemption'?\n");
printf("Options: a.)Martin Scorsese b.)Francis Ford Coppola c.)Steven Spielberg d.)Frank Darabont");
printf("Answer: ");
scanf("%s", answer);
if (strcmp(answer, "d") == 0) {
printf("Correct!\n");
score++;
} else {
printf("Incorrect. The answer is d.\n");
}
printf("Question 2: Who invented the telephone?\n");
printf("Options: a.)Alexander Graham Bell b.)Thomas Edison c.)Nikola Tesla d.)Gutenberg");
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();
@ -1239,6 +1270,7 @@ void b_epic_game() {
total_score += B_round4();
total_score += B_round5();
total_score += B_round6();
total_score += B_round7();
}

1
src/main/quizproject.h

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

Loading…
Cancel
Save