From 6bab5994751dad6b3d27ba62156e83513673aa17 Mon Sep 17 00:00:00 2001 From: fdlt3885 Date: Wed, 1 Feb 2023 22:43:37 +0000 Subject: [PATCH] added round 10 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 1bc3e05..e44a2c0 100644 --- a/src/main/quizproject.c +++ b/src/main/quizproject.c @@ -1317,6 +1317,37 @@ if (strcmp(answer, "a") == 0) { 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() { B_displayWelcomeMessage(); b_entertostart(); @@ -1335,6 +1366,8 @@ void b_epic_game() { total_score += B_round7(); total_score += B_round8(); total_score += B_round9(); + total_score += B_round10(); + } diff --git a/src/main/quizproject.h b/src/main/quizproject.h index 27555d7..b0a1865 100644 --- a/src/main/quizproject.h +++ b/src/main/quizproject.h @@ -63,6 +63,7 @@ int B_round6(void); int B_round7(void); int B_round8(void); int B_round9(void); +int B_round10(void); #define NUM_QUESTIONS 5