Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Trying to take input of int month from user and convert it to string month..What do you think is making it print default and not
Trying to take input of int month from user and convert it to string month..What do you think is making it print default and not my input?
Please note that this is only part of my code. Also, I have created a class called DayOfYear
int main() { int Pass1; DayOfYear Day2; Day2.input(); cout< void DayOfYear::input() { int d, m, y; cout<<"Enter Month: "; cin>>d; cout<<"Enter Day: "; cin>>m; cout<<"Enter Year: "; cin>>y; }string DayOfYear::monthHelper(int Num) { string mth; switch (Num) { case 1: mth = "January"; break; case 2: mth = "February"; break; case 3: mth = "March"; break; case 4: mth = "April"; break; case 5: mth = "May"; break; case 6: mth = "June"; break; case 7: mth = "July"; break; case 8: mth = "August"; break; case 9: mth = "September"; break; case 10: mth = "October"; break; case 11: mth = "November"; break; case 12: mth = "December"; break; } return mth; }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started