Answered step by step
Verified Expert Solution
Question
1 Approved Answer
dateType getDate) prmipl furmnth, dae retuTies in dutelype stuture CSIS 223 Objcct-Oriented Programming with C++ Lab03-DateStrueture dateType inputDate; Date Structure (Record) cout inputDate.month; f completed
dateType getDate) prmipl furmnth, dae retuTies in dutelype stuture CSIS 223 Objcct-Oriented Programming with C++ Lab03-DateStrueture dateType inputDate; Date Structure (Record) cout inputDate.month; f completed version to H:ICSIS223 and turn in a copy of the The program defines the dateType structure to hold an entered current date and cach prompted birth date Three function prototypes are given. Implement these functions after main(). Code main() routine below prompts and input for day and year return inputDate; struct dateType int ageInYears (dateType birthDate, dateType today) calcAge; int year Code algorithm to calculate age based on difference Enter month 11-12 between two dates (both passed in date Type structure). Subtract birth year from eurrent year giving if current month is less than birth month, prompt for month, day. year caleAge dateType getDate() int age InYears (dateType birthDate, dateType today); pass entered DOB and date today bool isEligible(int currAge, char sex); W eligibility based on age and gender subtract 1 from calcAge else if current month is squal to birth month int main() if current day of current month is less than birth month birth day value renot 11 122 dateType currDate; dateType dob; structure to store today's date y structure to store cach date of birth subtract 1 from calcAge. return calcage; prompt & inpus cout > gender; while (gender'Q'&& gender'q) Qenered to for cout gender; Vprompt for gender code M F input gender code (next instance) Enter month (1-131 Enter day of month:6 Test your program to see if a 65-year-old male and a 62-year-old female are correctly processed exactly on their eligible birthday, on the day before, and on the day after the eligible birthday system("pause); return 8
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