From 28da0b194af862ae417ab2a13a11bbd6a4b6a61c Mon Sep 17 00:00:00 2001 From: fdlt3885 Date: Wed, 1 Feb 2023 21:59:06 +0000 Subject: [PATCH] added round 3 function and header to epic game --- src/main/quizproject.c | 33 +++++++++++++++++++++++++++++++++ src/main/quizproject.h | 1 + 2 files changed, 34 insertions(+) diff --git a/src/main/quizproject.c b/src/main/quizproject.c index d17af44..1a2ca3d 100644 --- a/src/main/quizproject.c +++ b/src/main/quizproject.c @@ -1102,6 +1102,37 @@ int B_round2(void) { 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() { B_displayWelcomeMessage(); b_entertostart(); @@ -1113,9 +1144,11 @@ void b_epic_game() { total_score += B_testround(); total_score += B_round1(); total_score += B_round2(); + total_score += B_round3(); } + void feedbackForm(void){ int rating; char feedback[1000]; diff --git a/src/main/quizproject.h b/src/main/quizproject.h index ce40b5a..66f03a2 100644 --- a/src/main/quizproject.h +++ b/src/main/quizproject.h @@ -56,6 +56,7 @@ void B_show_time(void); int B_testround(void); int B_round1(void); int B_round2(void); +int B_round3(void); #define NUM_QUESTIONS 5 #define round 15