Browse Source

added y/n Breaking Bad Quiz

main
fdlt3885 2 years ago
parent
commit
9504d87f8a
  1. 65
      src/main/quizproject.c
  2. 3
      src/main/quizproject.h

65
src/main/quizproject.c

@ -2362,6 +2362,64 @@ void b_germanyquiz()
} }
//Breaking Bad Quiz
void b_BreakingBquiz() {
int score = 0;
char answer[4];
printf("---Welcome to Breaking Bad Quiz---\n");
printf("Answer each question with yes or no.\n");
printf("\nQuestion 1: Was Breaking Bad set in Albuquerque, New Mexico?\n");
scanf("%s", answer);
if (strcmp(answer, "yes") == 0) {
score++;
printf("Correct!\n");
} else {
printf("Incorrect.\n");
}
printf("\nQuestion 2: Did Walter White have a degree in chemistry?\n");
scanf("%s", answer);
if (strcmp(answer, "yes") == 0) {
score++;
printf("Correct!\n");
} else {
printf("Incorrect.\n");
}
printf("\nQuestion 3: Did Jesse Pinkman start cooking meth with Walter White because he needed money to pay for his girlfriend's medical bills?\n");
scanf("%s", answer);
if (strcmp(answer, "no") == 0) {
score++;
printf("Correct!\n");
} else {
printf("Incorrect.\n");
}
printf("\nQuestion 4: Did Walter White have a son with cerebral palsy?\n");
scanf("%s", answer);
if (strcmp(answer, "yes") == 0) {
score++;
printf("Correct!\n");
} else {
printf("Incorrect.\n");
}
printf("\nQuestion 5: Did Walter White die at the end of Breaking Bad?\n");
scanf("%s", answer);
if (strcmp(answer, "yes") == 0) {
score++;
printf("Correct!\n");
} else {
printf("Incorrect.\n");
}
printf("\nYour score: %d/5\n", score);
printf("\nThank you for playing Breaking Bad Quiz\n");
}
void v_play_rockpapersciss(){ void v_play_rockpapersciss(){
@ -2839,7 +2897,8 @@ int main(int argc, char *argv[]) {
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. Germany Quiz!\n"); printf("15. Germany Quiz!\n");
printf("16. Exit\n");
printf("16. Breaking Bad Quiz!\n");
printf("17. 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);
@ -2906,6 +2965,10 @@ int main(int argc, char *argv[]) {
jump_to_menu = 1; jump_to_menu = 1;
break; break;
case 16: case 16:
b_BreakingBquiz();
jump_to_menu = 1;
break;
case 17:
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

@ -113,6 +113,9 @@ void b_guessbirthyear();
//Germany Quiz Headers //Germany Quiz Headers
void b_germanyquiz(); void b_germanyquiz();
//Breaking Bad Quiz Headers
void b_BreakingBquiz();
#define NUM_QUESTIONS 5 #define NUM_QUESTIONS 5

Loading…
Cancel
Save