Browse Source

added round 10 function and header to epic game

main
fdlt3885 2 years ago
parent
commit
6bab599475
  1. 33
      src/main/quizproject.c
  2. 1
      src/main/quizproject.h

33
src/main/quizproject.c

@ -1317,6 +1317,37 @@ if (strcmp(answer, "a") == 0) {
return score; return score;
} }
int B_round10(void) {
int score = 0;
char answer[20];
printf("Round 10\n");
printf("Question 1: What is the chemical formula for water?\n");
printf("Options: a.)CO2 b.)O2 c.)H2O d.)N2O");
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 developed the theory of relativity?\n");
printf("Options: a.)Isaac Newton b.)Albert Einstein c.)Stephen Hawking d.)Neil deGrasse Tyson");
printf("Answer: ");
scanf("%s", answer);
if (strcmp(answer, "b") == 0) {
printf("Correct!\n");
score++;
} else {
printf("Incorrect. The answer is b.\n");
}
return score;
}
void b_epic_game() { void b_epic_game() {
B_displayWelcomeMessage(); B_displayWelcomeMessage();
b_entertostart(); b_entertostart();
@ -1335,6 +1366,8 @@ void b_epic_game() {
total_score += B_round7(); total_score += B_round7();
total_score += B_round8(); total_score += B_round8();
total_score += B_round9(); total_score += B_round9();
total_score += B_round10();
} }

1
src/main/quizproject.h

@ -63,6 +63,7 @@ int B_round6(void);
int B_round7(void); int B_round7(void);
int B_round8(void); int B_round8(void);
int B_round9(void); int B_round9(void);
int B_round10(void);
#define NUM_QUESTIONS 5 #define NUM_QUESTIONS 5

Loading…
Cancel
Save