Browse Source

added round two

main
fdlt3917 2 years ago
parent
commit
7e73a3dbbb
  1. 40
      src/main/quizproject.c

40
src/main/quizproject.c

@ -81,6 +81,8 @@ void fifty_fifty(int question_num) {
void looping(char qS[][100], char qC[][100], char aS[]){// 5
int k = 0;
while(k < 1){
printf("\t\t--------------------Round 1-------------------\n\n");
printf(">>In this round you need to answer 3 questions correctly to move to Round 2<<\n\n");
char response;
@ -111,7 +113,45 @@ void looping(char qS[][100], char qC[][100], char aS[]){// 5
} else {
wrong(score);
}
if (score < 1) {
printf("You lost! Better luck next time\n");
break;
} else {
printf("\t\t--------------------Round 2-------------------\n\n");
printf(">>In this round you need to answer 2 questions correctly to move to Round 3<<\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++;
}
}
}
void ask_questions(void) {

Loading…
Cancel
Save