Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Guessing Birthdays. Write a program (called q3.py) that guesses birthdays. You can determine the date of the month when someone was born by asking five
Guessing Birthdays. Write a program (called q3.py) that guesses birthdays. You can determine the date of the month when someone was born by asking five questions. Each question asks whether the day is in each of the five sets of numbers, which are shown below in Figure 1.
The birthday is the sum of the first numbers in the sets where the date appears. For example, if the birthday is 19, it appears in Set 1, Set 2, and Set 5. The first numbers in these three sets are 1, 2, and 16. Their sum is 19.
Example:
1 35723 6 9 1113 15 10 11 14 15 12 13 1415 17 192123 1819 22 23 2 21 22 23 25272931262730 31 28 29 30 31 Set 1 Set 2 Set 3 8 9 0 16 17 18 1 12 13 14 15 20 21 22 23 24252627 242526 27 28 29 30 31 282930 31 Set 4 Set 5 Figure 1: The five sets of numbers for guessing birthdays
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started