From 9504d87f8a0f864f5a69b15aabb3ca93afd6c119 Mon Sep 17 00:00:00 2001 From: fdlt3885 Date: Wed, 8 Feb 2023 21:27:54 +0000 Subject: [PATCH] added y/n Breaking Bad Quiz --- src/main/quizproject.c | 65 +++++++++++++++++++++++++++++++++++++++++- src/main/quizproject.h | 3 ++ 2 files changed, 67 insertions(+), 1 deletion(-) diff --git a/src/main/quizproject.c b/src/main/quizproject.c index 13591e3..2f75b9b 100644 --- a/src/main/quizproject.c +++ b/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(){ @@ -2839,7 +2897,8 @@ int main(int argc, char *argv[]) { printf("13. Basketball Quiz!\n"); printf("14. Guess Barack Obama's birth Year!\n"); printf("15. Germany Quiz!\n"); - printf("16. Exit\n"); + printf("16. Breaking Bad Quiz!\n"); + printf("17. Exit\n"); printf("Enter your choice: "); scanf("%d", &choice); v_progress_bar(argc,argv); @@ -2906,6 +2965,10 @@ int main(int argc, char *argv[]) { jump_to_menu = 1; break; case 16: + b_BreakingBquiz(); + jump_to_menu = 1; + break; + case 17: printf("\nThank you for trying our C code!\n"); break; default: diff --git a/src/main/quizproject.h b/src/main/quizproject.h index b9be8da..9eae280 100644 --- a/src/main/quizproject.h +++ b/src/main/quizproject.h @@ -113,6 +113,9 @@ void b_guessbirthyear(); //Germany Quiz Headers void b_germanyquiz(); +//Breaking Bad Quiz Headers +void b_BreakingBquiz(); + #define NUM_QUESTIONS 5