From a95afbbe46efa42de7645458177dc6b7bf01e089 Mon Sep 17 00:00:00 2001 From: fdlt3885 Date: Thu, 2 Feb 2023 22:09:30 +0000 Subject: [PATCH] Refactoring: edited question options (epic game) --- src/main/quizproject.c | 82 +++++++++++++++++++++--------------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/src/main/quizproject.c b/src/main/quizproject.c index 74034b1..4f155f0 100644 --- a/src/main/quizproject.c +++ b/src/main/quizproject.c @@ -1047,28 +1047,28 @@ int B_round1(void) { printf("Round 1\n\n"); printf("Question 1: What is the value of x in the equation 2x + 1 = 7?\n\n"); printf("Hint: Subtract 1 from both sides and then divide both sides by 2.\n\n"); - printf("Options: a.)1 b.)2 c.)3 d.)4\n\n"); + printf("Options: 6, 1, 3, 4\n\n"); printf("Answer: "); scanf("%s", answer); - if (strcmp(answer, "c") == 0) { + if (strcmp(answer, "3") == 0) { printf("Correct!\n\n"); score++; } else { - printf("Incorrect. The answer is c.\n\n"); + printf("Incorrect. The answer is 3.\n\n"); } printf("Question 2: What is the value of x in the equation 3x + 2 = 8?\n\n"); printf("Hint: Subtract 2 from both sides and then divide both sides by 3.\n\n"); - printf("Options: a.)1 b.)2 c.)3 d.)4\n\n"); + printf("Options: 1, 2, 3, 4\n\n"); printf("Answer: "); scanf("%s", answer); - if (strcmp(answer, "b") == 0) { + if (strcmp(answer, "2") == 0) { printf("Correct!\n\n"); score++; } else { - printf("Incorrect. The answer is b.\n\n"); + printf("Incorrect. The answer is 2.\n\n"); } return score; } @@ -1080,28 +1080,28 @@ int B_round2(void) { printf("Round 2 - True or False\n\n"); printf("Question 1: The sun rises in the west.\n\n"); printf("Hint:Think about the Earth's rotation on its axis towards the east.\n\n"); - printf("Options: a.)Ture b.)False\n\n"); + printf("Options: Ture, False\n\n"); printf("Answer: "); scanf("%s", answer); - if (strcmp(answer, "b") == 0) { + if (strcmp(answer, "False") == 0) { printf("Correct!\n\n"); score++; } else { - printf("Incorrect. The answer is b.\n\n"); + printf("Incorrect. The answer is False.\n\n"); } printf("Question 2: The capital city of France is known as the 'City of Love'.\n\n"); printf("Hint: It is one of the most popular cities in the world.\n\n"); - printf("Options: a.)Ture b.)False\n\n"); + printf("Options: True, False\n\n"); printf("Answer: "); scanf("%s", answer); - if (strcmp(answer, "a") == 0) { + if (strcmp(answer, "True") == 0) { printf("Correct!\n\n"); score++; } else { - printf("Incorrect. The answer is a.\n\n"); + printf("Incorrect. The answer is True.\n\n"); } return score; } @@ -1113,28 +1113,28 @@ int B_round3(void) { printf("Round 3\n\n"); printf("Question 1: How many planets are in our solar system?\n\n"); printf("Hint: Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, and Neptune.\n\n"); - printf("Options: a.)5 b.)6 c.)7 d.)8\n\n"); + printf("Options: 5, 6, 7, 8\n\n"); printf("Answer: "); scanf("%s", answer); - if (strcmp(answer, "d") == 0) { + if (strcmp(answer, "8") == 0) { printf("Correct!\n\n"); score++; } else { - printf("Incorrect. The answer is d.\n\n"); + printf("Incorrect. The answer is 8.\n\n"); } printf("Question 2: How many bones are there in the human body?\n\n"); printf("Hint: This number may vary in childhood due to some bones merging together as the body grows and develops.\n\n"); - printf("Options: a.)206 b.)205 c.)207 d.)204\n\n"); + printf("Options: 206, 205, 207, 204\n\n"); printf("Answer: "); scanf("%s", answer); - if (strcmp(answer, "a") == 0) { + if (strcmp(answer, "206") == 0) { printf("Correct!\n\n"); score++; } else { - printf("Incorrect. The answer is a.\n\n"); + printf("Incorrect. The answer is 206.\n\n"); } return score; } @@ -1145,15 +1145,15 @@ int B_round4(void) { printf("Round 4\n\n"); printf("Question 1: What is the capital of France?\n\n"); printf("Hint: It is known as the City of Light.\n\n"); - printf("Options: a.)Paris b.)London c.)Madrid d.)Berlin\n\n"); + printf("Options: Paris, London, Madrid, Berlin\n\n"); printf("Answer: "); scanf("%s", answer); - if (strcmp(answer, "a") == 0) { + if (strcmp(answer, "Paris") == 0) { printf("Correct!\n\n"); score++; } else { - printf("Incorrect. The answer is a.\n\n"); + printf("Incorrect. The answer is Paris.\n\n"); } printf("Question 2: Who painted the Mona Lisa?\n\n"); @@ -1174,18 +1174,18 @@ int B_round4(void) { int B_round5(void) { int score = 0; char answer[20]; - printf("Round 5\\nn"); + printf("Round 5\n\n"); printf("Question 1: Who invented the World Wide Web?\n\n"); printf("Hint: He is a British computer scientist.\n\n"); - printf("Options: a.)Bill Gates b.)Steve Jobs c.)Tim Berners-Lee d.)Mark Zuckerberg\n\n"); + printf("Options: Bill Gates, Steve Jobs, Tim Berners-Lee, Mark Zuckerberg\n\n"); printf("Answer: "); scanf("%s", answer); - if (strcmp(answer, "c") == 0) { + if (strcmp(answer, "Tim Berners-Lee") == 0) { printf("Correct!\n\n"); score++; } else { - printf("Incorrect. The answer is c.\n\n"); + printf("Incorrect. The answer is Tim Berners-Lee.\n\n"); } printf("Question 2: Who was the first person to walk on the Moon?\n\n"); @@ -1210,15 +1210,15 @@ char answer[20]; printf("Round 6\n\n"); printf("Question 1: Who wrote the novel 'To Kill a Mockingbird'?\n\n"); printf("Hint: She is known as an American novelist.\n\n"); -printf("Options: a.)Jane Austen b.)Agatha Christie c.)Harper Lee d.)Mary Shelley\n\n"); +printf("Options: Jane Austen, Agatha Christie, Harper Lee, Mary Shelley\n\n"); printf("Answer: "); scanf("%s", answer); -if (strcmp(answer, "c") == 0) { +if (strcmp(answer, "Harper Lee") == 0) { printf("Correct!\n\n"); score++; } else { - printf("Incorrect. The answer is c.\n\n"); + printf("Incorrect. The answer is Harper Lee.\n\n"); } printf("Question 2: Who painted the famous artwork 'The Starry Night'?\n\n"); @@ -1256,15 +1256,15 @@ if (strcmp(answer, "d") == 0) { printf("Question 2: Who invented the telephone?\n\n"); printf("Hint: He was a Scottish-born American inventor.\n\n"); -printf("Options: a.)Alexander Graham Bell b.)Thomas Edison c.)Nikola Tesla d.)Gutenberg\n\n"); +printf("Options: Alexander Graham Bell, Thomas Edison, Nikola Tesla, Gutenberg\n\n"); printf("Answer: "); scanf("%s", answer); -if (strcmp(answer, "a") == 0) { +if (strcmp(answer, "Alexander Graham Bell") == 0) { printf("Correct!\n\n"); score++; } else { - printf("Incorrect. The answer is a.\n\n"); + printf("Incorrect. The answer is Alexander Graham Bell.\n\n"); } return score; } @@ -1276,15 +1276,15 @@ char answer[20]; printf("Round 8\n\n"); printf("Question 1: Who played the lead role in the movie 'The Godfather'?\n\n"); printf("Hint: He is a legendary Hollywood actor.\n\n"); -printf("Options: a.)Marlon Brando b.)Robert De Niro c.)Al Pacino d.)Jack Nicholson\n\n"); +printf("Options: Marlon Brando, Robert De Niro, Al Pacino, Jack Nicholson\n\n"); printf("Answer: "); scanf("%s", answer); -if (strcmp(answer, "a") == 0) { +if (strcmp(answer, "Marlon Brando") == 0) { printf("Correct!\n\n"); score++; } else { - printf("Incorrect. The answer is a.\n\n"); + printf("Incorrect. The answer is Marlon Brando.\n\n"); } printf("Question 2: Who wrote the play 'Hamlet'?\n\n"); @@ -1309,11 +1309,11 @@ char answer[20]; printf("Round 9\n\n"); printf("Question 1: The median is the value separating the higher half from the lower half of a data set.\n\n"); printf("Hint: It is commonly used to represent the center of a dataset.\n\n"); -printf("Options: a.)True b.)False\n\n"); +printf("Options: True, False\n\n"); printf("Answer: "); scanf("%s", answer); -if (strcmp(answer, "a") == 0) { +if (strcmp(answer, "True") == 0) { printf("Correct!\n\n"); score++; } else { @@ -1322,11 +1322,11 @@ if (strcmp(answer, "a") == 0) { printf("Question 2: The mode of a data set is the value that occurs most frequently.\n\n"); printf("Hint: The mode is a statistical measure that represents the most frequently occurring value in a dataset.\n\n"); -printf("Options: a.)True b.)False\n\n"); +printf("Options: True, False\n\n"); printf("Answer: "); scanf("%s", answer); -if (strcmp(answer, "a") == 0) { +if (strcmp(answer, "True") == 0) { printf("Correct!\n\n"); score++; } else { @@ -1342,15 +1342,15 @@ char answer[20]; printf("Round 10\n\n"); printf("Question 1: What is the chemical formula for water?\n\n"); printf("Hint: It is composed of two hydrogen atoms and one oxygen atom.\n\n"); -printf("Options: a.)CO2 b.)O2 c.)H2O d.)N2O\n\n"); +printf("Options: CO2, O2, H2O, N2O\n\n"); printf("Answer: "); scanf("%s", answer); -if (strcmp(answer, "c") == 0) { +if (strcmp(answer, "H2O") == 0) { printf("Correct!\n"); score++; } else { - printf("Incorrect. The answer is c.\n\n"); + printf("Incorrect. The answer is H2O.\n\n"); } printf("Question 2: Who developed the theory of relativity?\n\n");