Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.


Solution:-

 

#include <iostream>
using namespace std;
class Student{
private:
string name;
int rollNumber;
string semester;
double cgpa;

public:
Student(string n,int r,string s,double c )
{name=n;
rollNumber=r;
semester=s;
cgpa=c;
}
Student()
{name="";
rollNumber=0;
semester="Summer 2010";
cgpa=4.0;
}


string get_semester()
{return semester;
}
void set_semester(string n)
{semester=n;
}
void set_roll(int n)
{rollNumber=n;
}
int get_roll()
{return rollNumber;
}
void set_name(string n)
{name=n;
}
string get_name()
{return name;
}
void set_cgpa(double n)
{cgpa=n;
}

double get_cgpa()
{return cgpa;
}
void print()
{cout"Student Information\n";
cout"Name: "nameendl;
cout"Roll number: "rollNumberendl;
cout"Semester: "semesterendl;
cout"Current GPA: "cgpaendlendl;
}
};

int main()
{Student a;
Student b("name",2345,"Spring 2010",3.5);
a.print();
b.print();
system("pause");
return 0;
}

Views: 266

Replies to This Discussion

plz jaldey jawab dein . Siraf Allah hey ebadat kay laiq hein .
Problem during compiling .........
is mein kahan correction key zaroorat hay . plz jaldey jawab dein.
Include the header file #include "string" with angle brackets, coz only that file hold this data type and it's definition. OMG! all the member functions declared in this class are working like inline functions. You guys should define all the function explicitly and only their prototypes will be included in the class.Then it will work fine, addios amigoes!
hahhahaahahah.........
Problem of assignment "The system can not find the file specified"
Solution ....... latest version use krain....
if problem in coding ....... follow the errors and correct
Assignemnt cs201-04 output
Attachments:
han bhai...... iss program mai problem hai...

plz check it...... and upload the update program

thanks in advance.......

aaj last date hai....... :((
Thanks for help in Assigment solution
some one check it plz.. and tell me is it ok.. ??
it gives me result, but i am not shure on this program..
urgent please..............

---------------------------------------------------------

#include
using namespace std;
class Student{
private:
string name;
int rollNumber;
string semester;
double cgpa;

public:
Student(string n,int r,string s,double c )
{name=n;
rollNumber=r;
semester=s;
cgpa=c;
}
Student()
{name="";
rollNumber=0;
semester="Summer 2010";
cgpa=4.0;
}


string get_semester()
{return semester;
}
void set_semester(string n)
{semester=n;
}
void set_roll(int n)
{rollNumber=n;
}
int get_roll()
{return rollNumber;
}
void set_name(string n)
{name=n;
}
string get_name()
{return name;
}
void set_cgpa(double n)
{cgpa=n;
}

double get_cgpa()
{return cgpa;
}
void print()
{
cout"Student Information\n";
cout"Kamal Khan "endl;
cout"MC100200133 "endl;
cout"1st "endl;
cout"3.5 "endl;
}
};

int main()
{Student a;
Student b("name",2345,"Spring 2010",3.5);
a.print();
b.print();
system("pause");
return 0;
}
#include
using namespace std;
class Student{
private:
string name;
int rollNumber;
string semester;
double cgpa;

public:
Student(string n,int r,string s,double c )
{name=n;
rollNumber=r;
semester=s;
cgpa=c;
}
Student()
{name="";
rollNumber=0;
semester="Summer 2010";
cgpa=2.3;
}


string get_semester()
{return semester;
}
void set_semester(string n)
{semester=n;
}
void set_roll(int n)
{rollNumber=n;
}
int get_roll()
{return rollNumber;
}
void set_name(string n)
{name=n;
}
string get_name()
{return name;
}
void set_cgpa(double n)
{cgpa=n;
}

double get_cgpa()
{return cgpa;
}
void print()
{cout"Student Information\n";
cout"Name: "nameendl;
cout"Roll number: "rollNumberendl;
cout"Semester: "semesterendl;
cout"Current GPA: "cgpaendl;
}

};

int main()
{Student a;
Student b("name",2345,"Spring 2010",3.5);
a.print();
b.print();
system("pause");
return 0;
}

RSS

© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service