|
@ -778,22 +778,42 @@ void math_question2(){ |
|
|
"[A]. y = 7x - 1 [b]. y = 3x - 1 [c]. y = 3x + 3 [d]. y = 3x + 1", |
|
|
"[A]. y = 7x - 1 [b]. y = 3x - 1 [c]. y = 3x + 3 [d]. y = 3x + 1", |
|
|
"[A]. x = -2 [b]. x = 3 [c]. x = 5 [d]. x = 11" |
|
|
"[A]. x = -2 [b]. x = 3 [c]. x = 5 [d]. x = 11" |
|
|
}; |
|
|
}; |
|
|
for_loop_print_question(math_question, math_possible_answer); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
char characters[] = { |
|
|
|
|
|
'A', |
|
|
|
|
|
'C', |
|
|
|
|
|
'B', |
|
|
|
|
|
'A', |
|
|
|
|
|
'D', |
|
|
|
|
|
'B', |
|
|
|
|
|
'C', |
|
|
|
|
|
'A', |
|
|
|
|
|
'D', |
|
|
|
|
|
'B' |
|
|
|
|
|
}; |
|
|
|
|
|
for_loop_print_question(math_question, math_possible_answer, characters); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void compare_answer(char compare, char character1){ |
|
|
|
|
|
int counter = 0; |
|
|
|
|
|
if (compare == character1) { |
|
|
|
|
|
counter++; |
|
|
|
|
|
printf("Right!, score is: %d\n", counter++); |
|
|
|
|
|
} else { |
|
|
|
|
|
printf("Wrong!\n"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
void for_loop_print_question(char mathQuestions[][140], char mathPossible[][140]) { |
|
|
|
|
|
for (int i = 1; i < 5; i++){ |
|
|
|
|
|
|
|
|
void for_loop_print_question(char mathQuestions[][140], char mathPossible[][140], char character[]) { |
|
|
|
|
|
for (int i = 0; i < 5; i++){ |
|
|
char user_answer; |
|
|
char user_answer; |
|
|
printf("[%d]. %s",i, mathQuestions[i]); |
|
|
printf("[%d]. %s",i, mathQuestions[i]); |
|
|
printf("%s", mathPossible[i]); |
|
|
printf("%s", mathPossible[i]); |
|
|
scanf(" %c", &user_answer); |
|
|
scanf(" %c", &user_answer); |
|
|
if (user_answer == 'A') { |
|
|
|
|
|
printf("Right!\n"); |
|
|
|
|
|
} else { |
|
|
|
|
|
printf("Wrong!\n"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
char character0 = character[i]; |
|
|
|
|
|
compare_answer(user_answer, character0); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|