#include<iostream>
using namespace std;
//class
class Gradebook
{
// Data members Scope public
public: int marks1;
public: int marks2;
//perametarized Constructor of class
public: Gradebook(int m1, int m2)
{
marks1=m1;
marks2=m2;
}
//Member methods or functions
public: void Display_Marks()
{
cout<<"Marks1 == "<<marks1<<endl;
cout<<"Marks2 == "<<marks2<<endl;
}
};
int main()
{
Gradebook mygradebook= Gradebook(100,23);
mygradebook.Display_Marks();
getchar();
return 0;
}
using namespace std;
//class
class Gradebook
{
// Data members Scope public
public: int marks1;
public: int marks2;
//perametarized Constructor of class
public: Gradebook(int m1, int m2)
{
marks1=m1;
marks2=m2;
}
//Member methods or functions
public: void Display_Marks()
{
cout<<"Marks1 == "<<marks1<<endl;
cout<<"Marks2 == "<<marks2<<endl;
}
};
int main()
{
Gradebook mygradebook= Gradebook(100,23);
mygradebook.Display_Marks();
getchar();
return 0;
}
No comments:
Post a Comment