From 73b97d306ef5710d7d96914499f35c922b6eeab4 Mon Sep 17 00:00:00 2001 From: fdlt3859 Date: Mon, 30 Jan 2023 15:26:24 +0000 Subject: [PATCH] Refactoring: Fact or Lie questions + minor fixes --- src/main/quizproject.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/quizproject.c b/src/main/quizproject.c index 7eff9b8..c93ba5f 100644 --- a/src/main/quizproject.c +++ b/src/main/quizproject.c @@ -440,9 +440,11 @@ displayThankYouMessage(); void v_factorlie(void){ char statements[][100] = { "Tomatoes are fruits.", // fact + "The Great Wall of China is visible from space.", // lie + "Water freezes at 0 degrees Celsius.", // fact }; - char answers[] = {'F'}; // L for lie, F for fact + char answers[] = {'F','L','F'}; // L for lie, F for fact int num_statements = sizeof(statements) / sizeof(statements[0]); int score = 0; @@ -456,9 +458,9 @@ void v_factorlie(void){ user_answer = toupper(user_answer); if (user_answer == answers[i]) { score++; - printf("Correct!\n"); + printf("Correct! You get a point.\n\n"); } else { - printf("Incorrect.\n"); + printf("Sorry, its incorrect. No points!\n\n"); } } printf("Your final score is %d out of %d.\n", score, num_statements);