From 4b315cb9c7efaf798e7461ed67d9d6f9497de090 Mon Sep 17 00:00:00 2001 From: fdlt3885 Date: Wed, 1 Feb 2023 22:40:23 +0000 Subject: [PATCH] added round 9 function and header to epic game --- src/main/quizproject.c | 32 ++++++++++++++++++++++++++++++++ src/main/quizproject.h | 2 ++ 2 files changed, 34 insertions(+) diff --git a/src/main/quizproject.c b/src/main/quizproject.c index e27fc31..1bc3e05 100644 --- a/src/main/quizproject.c +++ b/src/main/quizproject.c @@ -1286,6 +1286,37 @@ if (strcmp(answer, "a") == 0) { return score; } +int B_round9(void) { +int score = 0; +char answer[20]; + +printf("Round 9\n"); +printf("Question 1: The median is the value separating the higher half from the lower half of a data set.\n"); +printf("Options: a.)True b.)False"); +printf("Answer: "); +scanf("%s", answer); + +if (strcmp(answer, "a") == 0) { + printf("Correct!\n"); + score++; +} else { + printf("Incorrect. The answer is True.\n"); +} + +printf("Question 2: The mode of a data set is the value that occurs most frequently.\n"); +printf("Options: a.)True b.)False"); +printf("Answer: "); +scanf("%s", answer); + +if (strcmp(answer, "a") == 0) { + printf("Correct!\n"); + score++; +} else { + printf("Incorrect. The answer is True.\n"); +} +return score; +} + void b_epic_game() { B_displayWelcomeMessage(); b_entertostart(); @@ -1303,6 +1334,7 @@ void b_epic_game() { total_score += B_round6(); total_score += B_round7(); total_score += B_round8(); + total_score += B_round9(); } diff --git a/src/main/quizproject.h b/src/main/quizproject.h index 49001c0..27555d7 100644 --- a/src/main/quizproject.h +++ b/src/main/quizproject.h @@ -62,6 +62,8 @@ int B_round5(void); int B_round6(void); int B_round7(void); int B_round8(void); +int B_round9(void); + #define NUM_QUESTIONS 5 #define round 15