Browse Source

Refactoring: Added Question Golden Gate Bridge

main
fdlt3859 2 years ago
parent
commit
52cf19092a
  1. 18
      src/main/quizproject.c

18
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]);
}

Loading…
Cancel
Save