From 52cf19092a974d533c90fb2edb82828702dd71ea Mon Sep 17 00:00:00 2001 From: fdlt3859 Date: Wed, 25 Jan 2023 12:26:08 +0000 Subject: [PATCH] Refactoring: Added Question Golden Gate Bridge --- src/main/quizproject.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/main/quizproject.c b/src/main/quizproject.c index ec70c3c..9adbf1c 100644 --- a/src/main/quizproject.c +++ b/src/main/quizproject.c @@ -9,9 +9,9 @@ int* randomNumber() { srand(time(NULL)); int k = 0, p; - static int arr[3]; - while(k<3){ - int num =rand()%3; + static int arr[4]; + while(k<4){ + int num =rand()%4; for (p = 0; p < k; p++){ if(arr[p]==num){ break; @@ -162,7 +162,7 @@ int k = 0; 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"); - initial = 2, end = 3; + initial = 2, end = 4; printOutOption(qS,qC,aS,initial,end,randArr); } @@ -180,12 +180,14 @@ void ask_questions(void) { "What is the name of the tallest mountain in the world?\n", "Which country has the largest population in the world??\n", "What is the name of the longest river in Africa?\n", + "What American city is the Golden Gate Bridge located in?\n", }; char qC[][100] = {//6 "A.Mount Everest\nB.Uludag\nC.K2\nD.Makalu", "A.USA\nB.China\nC.Russia\nD.India", "A.Missisipi River\nB.Yangtze River\nC.Amazon River\nD.The Nile River", + "A.San Fransisco\nB.San Diego\nC.New York\nD.Los Angeles", }; @@ -194,6 +196,7 @@ void ask_questions(void) { 'A', 'B', 'D', + 'A', }; @@ -278,9 +281,10 @@ void ask_hard_questions(void) { void hint(int question_num) { char qC[][100] = { - "The Tallest mountain is 8,849m.", - "It's population is 1.412 billion.", - "The longest river measures 6,650km.", + "Hint:The Tallest mountain is 8,849m.", + "Hint:It's population is 1.412 billion.", + "Hint:The longest river measures 6,650km.", + "Hint:The Golden States Warriors play there.\n", }; printf("%s\n",qC[question_num]); }