From 8b47db84b7d8d5b471e05fe74c47dea28cfdddea Mon Sep 17 00:00:00 2001
From: fdlt3885 <berke.sevenler@lt.hs-fulda.de>
Date: Wed, 25 Jan 2023 09:45:17 +0000
Subject: [PATCH] Added Round 3

---
 src/main/quizproject.c | 45 ++++++++++++++++++++++++++++++++++++++----
 1 file changed, 41 insertions(+), 4 deletions(-)

diff --git a/src/main/quizproject.c b/src/main/quizproject.c
index c679246..f9ee65d 100644
--- a/src/main/quizproject.c
+++ b/src/main/quizproject.c
@@ -73,13 +73,13 @@ void wrong(int score1){
 }
 
 void fifty_fifty(int question_num) {
-    char qC[][100] = {//6
+    char qC[][100] = {
             "A.Mount Everest\nB.Uludag",
     };
     printf("%s\n",qC[question_num]);
 }
 
-void looping(char qS[][100], char qC[][100], char aS[]){// 5
+void looping(char qS[][100], char qC[][100], char aS[]){
 
 int k = 0;
     while(k < 1){
@@ -148,6 +148,43 @@ int k = 0;
                 }
             }
         }
+        if (score < 1) {
+                printf("You lost! Better luck next time\n");
+                break;
+            } else {
+                printf("\t\t--------------------Round 3-------------------\n\n");
+                printf(">>In this round you need to answer 2 questions correctly to move to Round 4<<\n\n");
+                char response;
+                for (int i = 0; i < 1; i++) {
+                    printf("%s\n", qS[i]);
+                    printf("%s\n", qC[i]);
+                    printf("Enter your answer (A, B, C, or D) or use a lifeline (F for 50/50, H for hint): ");
+                    scanf(" %c", &response);
+                    response = toupper(response);
+                    if (response == 'F') {
+                        fifty_fifty(i);
+                        printf("Enter your answer (A, B, C, or D): ");
+                        scanf(" %c", &response);
+                        response = toupper(response);
+                    } else if (response == 'H') {
+                        hint(i);
+                        printf("Enter your answer (A, B, C, or D): ");
+                        scanf(" %c", &response);
+                        response = toupper(response);
+
+                    }
+                }
+
+
+                if (response == aS[i]) {
+                    score++;
+                    correct(score);
+
+                } else {
+                    wrong(score);
+                }
+            }
+
         k++;
     }
 }
@@ -155,7 +192,7 @@ int k = 0;
 }
 
 void ask_questions(void) {
-    char qS[][100] = { //5
+    char qS[][100] = { 
             "What is the name of the tallest mountain in the world?\n"
             
 
@@ -176,7 +213,7 @@ void ask_questions(void) {
 }
 
 void hint(int question_num) {
-    char qC[][100] = {//6
+    char qC[][100] = {
             "The Tallest mountain is 8,849m."
     };
     printf("%s\n",qC[question_num]);