I'm working on a program in c++ that will get ask the user to enter a date such as (12 31) and the program will output the number of days and the day of the week so (12 31) will return (365 Tue). So far I have
#include <iostream>
using namespace std;
int main (){
while (true)
cout << "Enter date: "; cin >> mon >>day;
if (!mon && !day) break; //this is so that
when the user enters (0 0) the program ends
}
cout << "Bye" << endl;
return 0;
}
How should I get the program to match the date to a number and day of the week? I'm just starting to learn c++ through online tutorials so I'm not that fluent but I do know some stuff. Do I need to create a new function? My main issue is that I've hit a roadblock on how I should get the program to count the days from the given date, (I was thinking a range from 1-365). Not looking for an answer but some help would be nice.