Question
C++ Code: Make a program that reads a list of birthdays from a file called birthdays.txt (please make sure this name is exact). You will
C++ Code:
Make a program that reads a list of birthdays from a file called birthdays.txt (please make sure this name is exact). You will then ask the user to input a date and you are required to find: (1) who has the next birthday, (2) how many days away that birthday is from the input date and (3) how old the person will be on that birthday.
(Note: you DO need to take into account leap year (see example 3)).
The format of birthdays.txt will be:
name_put_together_with_underscores : mm/dd/yyyy
You may assume there is at least one birthday in birthdays.txt. You may also assume the date entered is valid. You do not need to check if the file opened correctly.
birthdays.txt:
Nick_Florin : 11/7/2000 David_Woodhouse : 8/12/1990 Michael_Smith : 11/13/1949 Mary_Rasmussen : 1/13/1987 Martin_Hughes : 3/13/1976 Melanie_Mouzon : 5/15/1933 Christine_Bonin : 2/10/1945 William_Holland : 6/13/1999 Doyle_Dye : 6/14/2014 Steve_Burkey_Frazier : 3/13/1972 Nell_Granberry : 4/25/1979 Madeleine_Daniel : 7/9/1968 Lillie_Callender : 6/16/1930 Shoshana_Falls : 5/27/1959
Example 1:
Current date? 1/1/2040 Next birthday: Mary_Rasmussen in 12 days will turn 81
Example 2:
Current date?
2/20/2017
Next birthday:
Martin_Hughes
in 21 days
will turn 58
Example 3:
Current date?
2/20/2016
Next birthday:
Martin_Hughes
in 22 days
will turn 57
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