Write a program that reads in twodates (using three integers for each) and displ
ID: 3653539 • Letter: W
Question
Write a program that reads in twodates (using three integers for each) and displays a messageshowing the date that comes first. Use the followingalgorithm: if the first date's year issmaller, it comes first Otherwise, if the second date'syear is smaller, it comes first Otherwise check the month todetermine which date comes first in a similar way If the months are the same thencheck the day. {{VERY IMPORTANT ADD THIS: -iMPUT VALIDATION -FUNCTION (BOOL) -(Y > 0) -1 < M < 12 -1 < d <31}}Explanation / Answer
#include using namespace std; bool validY(int y){ if(y>=0) return true; else return false; } bool validM(int m){ if((m>=1)&&(m=1)&&(dRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.