From ac91ecc6d457b732e18213d1400755baeab8e934 Mon Sep 17 00:00:00 2001 From: fdlt3885 Date: Wed, 1 Feb 2023 22:36:19 +0000 Subject: [PATCH] added round 8 function and header to epic game --- src/main/quizproject.c | 32 ++++++++++++++++++++++++++++++++ src/main/quizproject.h | 1 + 2 files changed, 33 insertions(+) diff --git a/src/main/quizproject.c b/src/main/quizproject.c index e91d45b..e27fc31 100644 --- a/src/main/quizproject.c +++ b/src/main/quizproject.c @@ -1255,6 +1255,37 @@ if (strcmp(answer, "a") == 0) { return score; } +int B_round8(void) { +int score = 0; +char answer[20]; + +printf("Round 8\n"); +printf("Question 1: Who played the lead role in the movie 'The Godfather'?\n"); +printf("Options: a.)Marlon Brando b.)Robert De Niro c.)Al Pacino d.)Jack Nicholson"); +printf("Answer: "); +scanf("%s", answer); + +if (strcmp(answer, "a") == 0) { + printf("Correct!\n"); + score++; +} else { + printf("Incorrect. The answer is a.\n"); +} + +printf("Question 2: Who wrote the play 'Hamlet'?\n"); +printf("Options: a.)William Shakespeare b.)Christopher Marlowe c.)Ben Jonson d.)John Milton"); +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(); @@ -1271,6 +1302,7 @@ void b_epic_game() { total_score += B_round5(); total_score += B_round6(); total_score += B_round7(); + total_score += B_round8(); } diff --git a/src/main/quizproject.h b/src/main/quizproject.h index 5ec38e7..49001c0 100644 --- a/src/main/quizproject.h +++ b/src/main/quizproject.h @@ -61,6 +61,7 @@ int B_round4(void); int B_round5(void); int B_round6(void); int B_round7(void); +int B_round8(void); #define NUM_QUESTIONS 5 #define round 15