Browse Source

added round 3 function and header to epic game

main
fdlt3885 2 years ago
parent
commit
28da0b194a
  1. 33
      src/main/quizproject.c
  2. 1
      src/main/quizproject.h

33
src/main/quizproject.c

@ -1102,6 +1102,37 @@ int B_round2(void) {
return score; return score;
} }
int B_round3(void) {
int score = 0;
char answer[20];
printf("Round 3\n");
printf("Question 1: How many planets are in our solar system?\n");
printf("Options: a.)5 b.)6 c.)7 d.)8");
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: How many bones are there in the human body? \n");
printf("Options: a.)206 b.)205 c.)207 d.)204");
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();
@ -1113,9 +1144,11 @@ void b_epic_game() {
total_score += B_testround(); total_score += B_testround();
total_score += B_round1(); total_score += B_round1();
total_score += B_round2(); total_score += B_round2();
total_score += B_round3();
} }
void feedbackForm(void){ void feedbackForm(void){
int rating; int rating;
char feedback[1000]; char feedback[1000];

1
src/main/quizproject.h

@ -56,6 +56,7 @@ 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); int B_round2(void);
int B_round3(void);
#define NUM_QUESTIONS 5 #define NUM_QUESTIONS 5
#define round 15 #define round 15

Loading…
Cancel
Save