we started classes, i need some pointers on my code if you can help
please.
Define a class called Month. Your class will have one attribute of type int to
represent a month (1 for January, 2 for February, and so forth). Include all the
following methods in this class:
(a) a constructor to set the month using the first three letters in the name of
the month as three arguments (‘J’ ‘A’ ‘N’ for January, ‘F’ ‘E’ ‘B’ for
February, and so forth),
( a constructor to set the month using an integer as an argument (1 for
January, 2 for February, and so forth),
a default constructor,
(d) an input function that reads the month as an integer,
(e) an input function that reads the month as the first three letters in the
name of the month,
(f) an output function that outputs the month as an integer,
(g) an output function that outputs the month as the first three letters in the
name of the month,
(h) and a member function that returns the next month as a value of type
Month.
heres my start
[#include<iostream>
#include<string>
using namespace std;
class Month{
public:
int month;
Month(int month);
Month(string& one,string& two,string& three);
Month();
void input1(intgoo month);
void input2(string one,string two,string three);
void output1();
void output2();
};
int main(){
Month month;
int m;
string one,two,three;
month.input1(m);
month.input2(one,two,three);
system("pause");
}
Month::Month(){
//nothing
}
void input1(int month){
cout<<"Enter the month as an integer: ";
cin>>month;
while(month<1||month>12){
cout<<"Wrong number.";
cin>>month;
}
}
void input2(string one,string two,string three){
int count=0;
cout<<"Enter the month as an string(3 letters): ";
while(count<3){
cin>>one;
cin>>two;
cin>>three;
count+=4;
}
}
]