Browse Source

Added Germany Quiz game and header

main
fdlt3885 2 years ago
parent
commit
1e7c183005
  1. 75
      src/main/quizproject.c
  2. 4
      src/main/quizproject.h

75
src/main/quizproject.c

@ -2295,6 +2295,74 @@ void b_guessbirthyear()
} }
//Germany Quiz
void b_germanyquiz()
{
int score = 0;
printf("Welcome to Germany Quiz.\n\n");
printf("1. Germany is located in Europe.\n");
printf("True or False?\n");
char answer1[5];
scanf("%s", answer1);
if (strcmp(answer1, "True") == 0) {
printf("Correct!\n");
score++;
} else {
printf("Incorrect. The answer is True.\n");
}
printf("2. Berlin is the capital city of Germany.\n");
printf("True or False?\n");
char answer2[5];
scanf("%s", answer2);
if (strcmp(answer2, "True") == 0) {
printf("Correct!\n");
score++;
} else {
printf("Incorrect. The answer is True.\n");
}
printf("3. The currency used in Germany is the Euro.\n");
printf("True or False?\n");
char answer3[5];
scanf("%s", answer3);
if (strcmp(answer3, "True") == 0) {
printf("Correct!\n");
score++;
} else {
printf("Incorrect. The answer is True.\n");
}
printf("4. The population of Germany is over 100 million.\n");
printf("True or False?\n");
char answer4[5];
scanf("%s", answer4);
if (strcmp(answer4, "False") == 0) {
printf("Correct!\n");
score++;
} else {
printf("Incorrect. The answer is False.\n");
}
printf("5. The official language of Germany is French.\n");
printf("True or False?\n");
char answer5[5];
scanf("%s", answer5);
if (strcmp(answer5, "False") == 0) {
printf("Correct!\n");
score++;
} else {
printf("Incorrect. The answer is False.\n");
}
printf("You scored %d out of 5.\n", score);
printf("Thank You for Playing Germany Quiz.\n");
}
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;
@ -2770,7 +2838,8 @@ int main(int argc, char *argv[]) {
printf("12. Mini-Game: Guess the animal!\n"); printf("12. Mini-Game: Guess the animal!\n");
printf("13. Basketball Quiz!\n"); printf("13. Basketball Quiz!\n");
printf("14. Guess Barack Obama's birth Year!\n"); printf("14. Guess Barack Obama's birth Year!\n");
printf("15. Exit\n");
printf("15. Germany Quiz!\n");
printf("16. 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);
@ -2833,6 +2902,10 @@ int main(int argc, char *argv[]) {
jump_to_menu = 1; jump_to_menu = 1;
break; break;
case 15: case 15:
b_germanyquiz();
jump_to_menu = 1;
break;
case 16:
printf("\nThank you for trying our C code!\n"); printf("\nThank you for trying our C code!\n");
break; break;
default: default:

4
src/main/quizproject.h

@ -110,6 +110,10 @@ void b_basketballQuiz();
//Guess Birth Year Headers //Guess Birth Year Headers
void b_guessbirthyear(); void b_guessbirthyear();
//Germany Quiz Headers
void b_germanyquiz();
#define NUM_QUESTIONS 5 #define NUM_QUESTIONS 5
#define NUM_ROUNDS 15 #define NUM_ROUNDS 15

Loading…
Cancel
Save