Question: #include #include #include using namespace std; bool LeapYear ( int year ) { return ( year % 4 = = 0 && year % 1
#include
#include
#include
using namespace std;
bool LeapYearint year
return year && year year ;
int daysInMonthint month, int year
if month
return LeapYearyear : ;
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 LeapYeary : ;
totalDays daysInYearyear month, day;
return totalDays;
string dayOfWeekint dayValue
string daysMonday "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday";
Base date is a Monday, so no adjustment is needed
return daysdayValue ; Adjust for correct index
int main
ifstream inputFiledatestxt;
string line;
while getlineinputFile line
int month, day, year;
sscanflinecstrddd &month, &day, &year; Assuming the input format is MMDDYYYY
int value dayValueyear month, day;
string dayName dayOfWeekvalue;
bool leapYear LeapYearyear;
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 ;
visual studio, using c is giving me an error with scanf and wont run
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
