Browse Source

added round 2 function and header to epic game

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

32
src/main/quizproject.c

@ -1071,6 +1071,37 @@ int B_round1(void) {
return score; return score;
} }
int B_round2(void) {
int score = 0;
char answer[20];
printf("Round 2 - True or False\n");
printf("Question 1: The sun rises in the west.\n");
printf("Options: a.)Ture b.)False");
printf("Answer: ");
scanf("%s", answer);
if (strcmp(answer, "b") == 0) {
printf("Correct!\n");
score++;
} else {
printf("Incorrect. The answer is b.\n");
}
printf("Question 2: The capital city of France is known as the 'City of Love'.\n");
printf("Options: a.)Ture b.)False");
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();
@ -1081,6 +1112,7 @@ void b_epic_game() {
int total_score = 0; int total_score = 0;
total_score += B_testround(); total_score += B_testround();
total_score += B_round1(); total_score += B_round1();
total_score += B_round2();
} }

1
src/main/quizproject.h

@ -55,6 +55,7 @@ void B_displayGameInstructions(void);
void B_show_time(void); void B_show_time(void);
int B_testround(void); int B_testround(void);
int B_round1(void); int B_round1(void);
int B_round2(void);
#define NUM_QUESTIONS 5 #define NUM_QUESTIONS 5
#define round 15 #define round 15

Loading…
Cancel
Save