-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAssignment 6.cpp
More file actions
105 lines (103 loc) · 1.88 KB
/
Assignment 6.cpp
File metadata and controls
105 lines (103 loc) · 1.88 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
//============================================================================
// Name : Assignment.cpp
// Author :
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <iostream>
using namespace std;
class Personal{
public:
string name,phone,add;
double dob;
Personal()
{
cout<<"Constructor of Personal class!"<<endl;
}
void input()
{
cout<<"Enter name : ";
cin>>name;
cout<<"Enter phone number : ";
cin>>phone;
cout<<"Enter DOB(DDMMYYYY) : ";
cin>>dob;
cout<<"Enter address : ";
cin>>add;
}
void output()
{
cout<<"Name : "<<name<<endl;
cout<<"Phone number : "<<phone<<endl;
cout<<"Date of Birth : "<<dob<<endl;
cout<<"Address : "<<add<<endl;
}
};
class Professional
{
public:
string comp,desig;
Professional()
{
cout<<"Constructor of Professional class!"<<endl;
}
void input()
{
cout<<"Enter company name : ";
cin>>comp;
cout<<"Enter designation : ";
cin>>desig;
}
void output()
{
cout<<"Company : "<<comp<<endl;
cout<<"Designation : "<<desig<<endl;
}
};
class Academic
{
public:
string qual;
float hsc,ssc;
Academic()
{
cout<<"Constructor of Academic class called!"<<endl;
}
void input()
{
cout<<"Enter qualification : ";
cin>>qual;
cout<<"Enter HSC percentage : ";
cin>>hsc;
cout<<"Enter SSC percentage : ";
cin>>ssc;
}
void output()
{
cout<<"Qualification : "<<qual<<endl;
cout<<"HSC percentage : "<<hsc<<endl;
cout<<"SSC percentage : "<<ssc<<endl;
}
};
class Bio: public Personal, public Professional, public Academic{
public:
void input()
{
Personal::input();
Professional::input();
Academic::input();
}
void output()
{
Personal::output();
Professional::output();
Academic::output();
}
};
int main() {
Bio o1;
o1.input();
o1.output();
return 0;
}