Hello,
I have an assignment in which i must create a program which prompts for user input of current and birth date, which will compare said dates and output if its your birthday or not. I've completed a large portion of it, but cannot figure out how to get the user input of month as an integer such a 2 into february. any help is much appreciated.
In the class, you have the month as type int. Instead, try having it as type string.
Then, whenever the user enters a number for the month, do some if statements to set the month for the class based off of the input - that sounds confusing (This means in the input function, allow them to enter an int for the month)
Case:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
DayofYear::input
{
cin >> "month as a number"
getMonth("month as a number")
}
getMonth(int"month as a number")
{
if("month as a number" == 1) today.month = "January";
.
.
.
else today.month = "December"
}