Browse Source

Added Football Quiz and headers

main
fdlt3885 2 years ago
parent
commit
b7138cc4ba
  1. 63
      src/main/quizproject.c
  2. 3
      src/main/quizproject.h

63
src/main/quizproject.c

@ -2896,6 +2896,60 @@ void b_hangman() {
} }
//Football Quiz
void b_football() {
int score = 0;
char answer[20];
printf("Football History Quiz (before 2000)\n\n");
printf("Q1) Who won the 1966 FIFA World Cup?\n");
printf("A) England\nB) Germany\nC) Argentina\nD) Brazil\n\n");
printf("Enter your answer: ");
scanf("%s", answer);
if (strcmp(answer, "A") == 0 || strcmp(answer, "a") == 0)
{
printf("Correct!\n");
score++;
}
else
{
printf("Incorrect. The correct answer was England.\n");
}
printf("\nQ2) Which club won the first ever UEFA Champions League in 1955?\n");
printf("A) Real Madrid\nB) Barcelona\nC) AC Milan\nD) Bayern Munich\n\n");
printf("Enter your answer: ");
scanf("%s", answer);
if (strcmp(answer, "A") == 0 || strcmp(answer, "a") == 0)
{
printf("Correct!\n");
score++;
}
else
{
printf("Incorrect. The correct answer was Real Madrid.\n");
}
printf("\nQ3) Who was the first player to win three Ballon d'Or awards?\n");
printf("A) Lionel Messi\nB) Cristiano Ronaldo\nC) Johan Cruyff\nD) Michel Platini\n\n");
printf("Enter your answer: ");
scanf("%s", answer);
if (strcmp(answer, "C") == 0 || strcmp(answer, "c") == 0)
{
printf("Correct!\n");
score++;
}
else
{
printf("Incorrect. The correct answer was Johan Cruyff.\n");
}
printf("\nYour total score is %d out of 3\n", score);
}
void v_play_rockpapersciss(){ void v_play_rockpapersciss(){
int player_choice, computer_choice, player_score = 0, computer_score = 0; int player_choice, computer_choice, player_score = 0, computer_score = 0;
@ -3492,7 +3546,7 @@ int main(int argc, char *argv[]) {
int jump_to_menu = 0; int jump_to_menu = 0;
while (choice != 25 || jump_to_menu) {
while (choice != 26 || jump_to_menu) {
printf("Welcome to the Game Menu!\n"); printf("Welcome to the Game Menu!\n");
printf("1. QuizGame\n"); printf("1. QuizGame\n");
printf("2. Fact or Lie?\n"); printf("2. Fact or Lie?\n");
@ -3518,7 +3572,8 @@ int main(int argc, char *argv[]) {
printf("22. Personality Quiz!\n"); printf("22. Personality Quiz!\n");
printf("23. Guess the Celebrity!\n"); printf("23. Guess the Celebrity!\n");
printf("24. Hangman!\n"); printf("24. Hangman!\n");
printf("25. Exit\n");
printf("25. Football Quiz!\n");
printf("26. Exit\n");
printf("Enter your choice: "); printf("Enter your choice: ");
scanf("%d", &choice); scanf("%d", &choice);
v_progress_bar(argc,argv); v_progress_bar(argc,argv);
@ -3621,6 +3676,10 @@ int main(int argc, char *argv[]) {
jump_to_menu = 1; jump_to_menu = 1;
break; break;
case 25: case 25:
b_football();
jump_to_menu = 1;
break;
case 26:
printf("\nThank you for trying our C code!\n"); printf("\nThank you for trying our C code!\n");
break; break;
default: default:

3
src/main/quizproject.h

@ -153,6 +153,9 @@ char answer;
//Hangman Headers //Hangman Headers
void b_hangman(); void b_hangman();
//Football Quiz Headers
void b_football();
//-------brain_whiz_header_begin------------ //-------brain_whiz_header_begin------------
void for_loop_print_question(char [][140], char [][140], char []); void for_loop_print_question(char [][140], char [][140], char []);

Loading…
Cancel
Save