From c7f12438e3ca4687dee2950754c12a8f31167357 Mon Sep 17 00:00:00 2001 From: fdlt3914 Date: Wed, 25 Jan 2023 10:22:24 +0000 Subject: [PATCH] final score and thankyou message func --- src/main/quizproject.c | 10 +++++++++- src/main/quizproject.h | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/quizproject.c b/src/main/quizproject.c index d59b6de..ee66202 100644 --- a/src/main/quizproject.c +++ b/src/main/quizproject.c @@ -103,7 +103,6 @@ void printOutOption(char qS[][100], char qC[][100],char aS[]){ if(response == aS[i]){ score++; correct(score); - fact(i); } else { wrong(score); } @@ -145,6 +144,8 @@ int k = 0; k++; } + printf("\nYour final score: %d\n", score); + } void ask_questions(void) { @@ -175,6 +176,12 @@ void hint(int question_num) { printf("%s\n",qC[question_num]); } +void displayThankYouMessage(void) { // 4 & 5 + printf("*******************************\n"); + printf("Thank you for playing QuizGame!\n"); + printf("*******************************\n\n"); +} + int main(){ displayInstructions(); @@ -186,6 +193,7 @@ int main(){ } printf("\n"); ask_questions(); +displayThankYouMessage(); return 0; } diff --git a/src/main/quizproject.h b/src/main/quizproject.h index 79d9a28..bd5a2a6 100644 --- a/src/main/quizproject.h +++ b/src/main/quizproject.h @@ -13,5 +13,6 @@ void correct(int); void wrong(int); int score = 0; void printOutOption(char [][100], char [][100],char []); +void displayThankYouMessage(void); #endif