Question: #include #include #include using namespace std; bool isLeapYear ( int year ) { return ( year % 4 = = 0 && year % 1
#include
#include
#include
using namespace std;
bool isLeapYearint year
return year && year year ;
int daysInMonthint month, int year
if month
return isLeapYearyear : ;
return month month month month : ;
int daysInYearint year, int month, int day
int days ;
for int m ; m month; m
days daysInMonthm year;
days day;
return days;
int dayValueint year, int month, int day
int totalDays ;
for int y ; y year; y
totalDays isLeapYeary : ;
totalDays daysInYearyear month, day;
return totalDays;
string dayOfWeekint dayValue
string daysMonday "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday";
return daysdayValue ;
int main
ifstream inputFiledatestxt;
string line;
while getlineinputFile line
int month, day, year;
int value dayValueyear month, day;
string dayName dayOfWeekvalue;
bool leapYear isLeapYearyear;
cout dayName month day year
has a day value of value
leapYear and is a leap year." : and is not a leap year." endl;
inputFile.close;
return ;
The code is reading the input file but the values in the output are not working correctly to show the value of the day, correct day of the week for the date and if the year was a leap year correctly. ive attached a screenshout of the output im correctly getting
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
