Browse Source

give solution to wrong questions in hard question.

main
parent
commit
1092a89632
  1. 18
      src/main/quizproject.c
  2. 2
      src/main/quizproject.h

18
src/main/quizproject.c

@ -267,11 +267,22 @@ void e_math_ques() {
'B', 'B',
}; };
e_math_print(e_math, e_math_possible, e_math_solution);
char e_math_statement[][100] = {
"Solution: x = 2",
"Solution: 4x^2 - 9x + 6 = 4x^2 - 9x + 6x - 6x + 6 = 4x^2 - 3x + 6",
"Solution: The slope of the line is 2.",
"Solution: The equation of the line is y = 2x - 2.",
"Solution: 3(2x + 4) - 5 = 6x + 12 - 5 = 6x + 7",
"Solution: The equation of the line is y = -0.5x + 8.5.",
"Solution: x = -2 or x = -2",
"Solution: 2(x + 3) + 4(x + 2) = 2x + 6 + 4x + 8 = 6x + 14",
"Solution: The equation of the circle is (x - 3)^2 + (y - 4)^2 = 25.",
"Solution: x = 6.",
};
e_math_print(e_math, e_math_possible, e_math_solution, e_math_statement);
} }
void e_math_print(char e_ques[][140], char e_poss[][140], char e_math_solution[]){
void e_math_print(char e_ques[][140], char e_poss[][140], char e_math_solution[], char e_math_statement[][100]){
int i = 0; int i = 0;
@ -286,6 +297,7 @@ void e_math_print(char e_ques[][140], char e_poss[][140], char e_math_solution[]
printf("Correct!\n"); printf("Correct!\n");
} else { } else {
printf("Wrong!\n"); printf("Wrong!\n");
printf("%s\n\n", e_math_statement[i]);
} }
i++; i++;
} }

2
src/main/quizproject.h

@ -43,7 +43,7 @@ int math_answer(int);
void math_display_choice(); void math_display_choice();
void math_enter_game(); void math_enter_game();
void e_math_ques(void); void e_math_ques(void);
void e_math_print(char [][140], char [][140], char []);
void e_math_print(char [][140], char [][140], char [], char [][100]);
void math_help(void); void math_help(void);
void math_choose_game(void); void math_choose_game(void);

Loading…
Cancel
Save