This repository has been archived by the owner on Oct 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtimemain.cpp
75 lines (75 loc) · 1.39 KB
/
timemain.cpp
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#include"time.h"
#include"complex.h"
int main()
{
Time a;
int choice,option;
cout<<"\n\n\n Time Operations With Operator Overloading \n\n\n";
do
{
cout<<" 1. Input And Display \n";
cout<<" 2. Addition \n";
cout<<" 3. Subtraction \n";
cout<<" 4. Addition Using Any Value \n";
cout<<" 5. Exit \n";
cout<<" Enter Choice : ";
cin>>option;
switch(option)
{
case 1 :
{
cout<<"\n\n Input and Display \n\n";
a.input();
a.display();
break;
}
case 2 :
{
Time b,c;
cout<<"\n\n Addition \n\n";
a.input();
a.display();
b.input();
b.display();
c=a+b;
c.display();
break;
}
case 3 :
{
Time b,c;
cout<<"\n\n Subtraction \n\n";
a.input();
a.display();
b.input();
b.display();
c=a-b;
c.display();
break;
}
case 4 :
{
Time c;
int value;
cout<<"\n\n Addition Using Any Value \n\n";
a.input();
a.display();
cout<<" Enter The Value To Be Added : ";
cin>>value;
c=a*value;
c.display();
break;
}
default:
{
cout<<"\n\n Exiting The Program.....\n\n";
break;
}
}
cout<<"\n\n Do You Want To Continue ( Type 0 Or 1 ) : ";
cin>>choice;
cout<<endl<<endl;
}while(choice);
cout<<"\n\n The End \n\n";
return 0;
}