Skip to content

Commit aa081f6

Browse files
authored
Create Single_level_Inheritance.cpp
1 parent 03740e5 commit aa081f6

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Single_level_Inheritance.cpp

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#include <iostream>
2+
using namespace std;
3+
class Account {
4+
public:
5+
float salary = 60000;
6+
};
7+
class Programmer: public Account {
8+
public:
9+
float bonus = 5000;
10+
};
11+
int main(void) {
12+
Programmer p1;
13+
cout<<"Salary: "<<p1.salary<<endl;
14+
cout<<"Bonus: "<<p1.bonus<<endl;
15+
return 0;
16+
}

0 commit comments

Comments
 (0)