Browse Source

Added horoscope checker

main
fdlt3859 2 years ago
parent
commit
bebfc870ca
  1. 48
      src/main/quizproject.c
  2. 3
      src/main/quizproject.h

48
src/main/quizproject.c

@ -2206,6 +2206,47 @@ void v_play_rockpapersciss(){
printf("******************************************\n\n"); printf("******************************************\n\n");
} }
void v_horoscope(int day, int month){
if ((month == 3 && day >= 21) || (month == 4 && day <= 19)) {
printf("Your horoscope is Aries.\n");
} else if ((month == 4 && day >= 20) || (month == 5 && day <= 20)) {
printf("Your horoscope is Taurus.\n");
} else if ((month == 5 && day >= 21) || (month == 6 && day <= 20)) {
printf("Your horoscope is Gemini.\n");
} else if ((month == 6 && day >= 21) || (month == 7 && day <= 22)) {
printf("Your horoscope is Cancer.\n");
} else if ((month == 7 && day >= 23) || (month == 8 && day <= 22)) {
printf("Your horoscope is Leo.\n");
} else if ((month == 8 && day >= 23) || (month == 9 && day <= 22)) {
printf("Your horoscope is Virgo.\n");
} else if ((month == 9 && day >= 23) || (month == 10 && day <= 22)) {
printf("Your horoscope is Libra.\n");
} else if ((month == 10 && day >= 23) || (month == 11 && day <= 21)) {
printf("Your horoscope is Scorpio.\n");
} else if ((month == 11 && day >= 22) || (month == 12 && day <= 21)) {
printf("Your horoscope is Sagittarius.\n");
} else if ((month == 12 && day >= 22) || (month == 1 && day <= 19)) {
printf("Your horoscope is Capricorn.\n");
} else if ((month == 1 && day >= 20) || (month == 2 && day <= 18)) {
printf("Your horoscope is Aquarius.\n");
} else if ((month == 2 && day >= 19) || (month == 3 && day <= 20)) {
printf("Your horoscope is Pisces.\n");
} else {
printf("Invalid birth date.\n");
}
}
void v_play_horoscope(void) {
int day, month;
printf("Enter your birth day: ");
scanf("%d", &day);
printf("Enter your birth month (in number): ");
scanf("%d", &month);
v_horoscope(day, month);
}
void feedbackForm(void){ void feedbackForm(void){
int rating; int rating;
@ -2301,7 +2342,8 @@ int main(int argc, char *argv[]) {
printf("7. Epic Game\n"); printf("7. Epic Game\n");
printf("8. Rock,Paper,Scissors!\n"); printf("8. Rock,Paper,Scissors!\n");
printf("9. Math Quiz\n"); printf("9. Math Quiz\n");
printf("10. Exit\n");
printf("10. Check your Horoscope!\n");
printf("11. 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);
@ -2344,6 +2386,10 @@ int main(int argc, char *argv[]) {
jump_to_menu = 1; jump_to_menu = 1;
break; break;
case 10: case 10:
v_play_horoscope();
jump_to_menu = 1;
break;
case 11:
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

@ -31,7 +31,8 @@ void v_guessTheWord(char word[], char guessed[]);
void progress_bar(int percentage); void progress_bar(int percentage);
void v_progress_bar(int argc, char *argv[]); void v_progress_bar(int argc, char *argv[]);
void v_play_rockpapersciss(void); void v_play_rockpapersciss(void);
void v_horoscope(int day, int month);
void v_play_horoscope(void);
void million_instructions(); void million_instructions();
void million_exit(int million_a); void million_exit(int million_a);

Loading…
Cancel
Save