-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlab6program.cpp
More file actions
45 lines (37 loc) · 851 Bytes
/
lab6program.cpp
File metadata and controls
45 lines (37 loc) · 851 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//preprocessor directives
#include <iostream>
#include <string>
#include <vector>
//importing class
#include "Month.h"
using namespace std;
int main()
{
//declaring instances of the class
Month m1("February");
Month m2, m3, m4;
cout << m1.getMonthName() << endl;
cout << m1.getMonthNumber() << endl;
cout << endl;
cout << m1;
cout << endl;
//overloaded prefix ++ operator
m2 = ++m1;
//overloaded cout stream extraction operator
cout << m1;
cout << m2;
cout << endl;
//overloaded postfix ++ operator
m3 = m1++;
//overloaded cout stream extraction operator
cout << m1;
cout << m3;
cout << endl;
cout << "Enter the name of a month: ";
//overloaded cin stream insertion operator
cin >> m4;
//overloaded cout stream extraction operator
cout << m4;
system("Pause");
return 0;
}