0% found this document useful (0 votes)
7 views

5 Classes 1

Uploaded by

aa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

5 Classes 1

Uploaded by

aa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

#include<iostream>

#include<string>
using namespace std;

//
//class Student
//{
//public:
// //data member
// int id_;
// string name_;
// double gpa_;
// string address_;
//
//
// //member function
// void printStudentInfo()
// {
// cout << id_ << endl << name_ << endl << gpa_ << endl << address_ <<
endl << endl;
// }
//
// double addBonus(double amt)
// {
// return gpa_ + amt;
// }
//
// void modifyName(string StudentName)
// {
// name_ = StudentName;
// }
//
//};
//
//int main()
//{
// //Not Object Oriented
// /*int id;
// string name;
// double gpa;
// string address;
//
// id = 1;
// name = "Samer";
// gpa = 90.0;
// address = "Amman";
// cout << id << endl << name << endl << gpa << endl << address << endl << endl;
//
//
// id = 2;
// name = "Omar";
// gpa = 70;
// address = "Salt";
// cout << id << endl << name << endl << gpa << endl << address << endl << endl;
//
//
// id = 3;
// name = "Ali";
// gpa = 50;
// address = "Oman";
// cout << id << endl << name << endl << gpa << endl << address << endl <<
endl;*/
//
//
//
// //Object Oriented
// Student st1;
// Student st2;
//
//
// st1.id_ = 1;
// st1.name_ = "Samer";
// st1.address_ = "Amman";
// st1.gpa_ = 90.0;
// //cout << st1.id_ << endl << st1.name_ << endl << st1.gpa_ << endl <<
st1.address_ << endl << endl;
// st1.printStudentInfo();
// cout << st1.addBonus(5.0) << endl << endl;
//
//
// st2.id_ = 2;
// st2.name_ = "Omar";
// st2.address_ = "Salt";
// st2.gpa_ = 70.0;
// //cout << st2.id_ << endl << st2.name_ << endl << st2.gpa_ << endl <<
st2.address_ << endl << endl;
// st2.printStudentInfo();
// cout << st2.addBonus(7.0) << endl << endl;
//
// st2.name_ = "Ammar";//set new name
// st2.printStudentInfo();
//
//
// st2.modifyName("Ahmed");
// st2.printStudentInfo();
//
//
// cin >> st2.name_;
// cout << endl << endl;
// st2.printStudentInfo();
//
//
//
//
// Student st3;
// st3.addBonus(5.0);//problem of rabish data
//
// st3.printStudentInfo();//rabish data
//}

You might also like