I am trying to implement my idea into coding
This is my attempt
I think It might be more meaningful. I want to add the data hiding features in code. I would create new class of student from person class.
I am not looking for a code I am looking idea how to add data hiding and inheritance to improve previous idea
This is my attempt
Code:
#include<iostream>
using namespace std;
class Person
{
public:
int age;
int weight;
private:
char ID;
protected:
int password;
};
int main ()
{
class Person Object1;
Object1.age = 20;
Object1.weight = 40;
cout<<"Age : "<<Object1.age<<endl;
cout<<"Weight : "<<Object1.weight<<endl;
return 0;
}
I am not looking for a code I am looking idea how to add data hiding and inheritance to improve previous idea