We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
/*
Enter code for class Student here.
Read statement for specification.
*/
class Student
{
private:
int a;
int class1;
string f,l;
public:
void set_age(int age);
int get_age(void);
void set_first_name(string first_name);
string get_first_name(void);
void set_last_name(string last_name);
void set_standard(int standard);
string get_last_name();
int get_standard();
string to_string();
Class
You are viewing a single comment's thread. Return to all comments →
include
include
include "string"
using namespace std;
/* Enter code for class Student here. Read statement for specification. */ class Student { private: int a; int class1; string f,l; public: void set_age(int age); int get_age(void); void set_first_name(string first_name); string get_first_name(void); void set_last_name(string last_name); void set_standard(int standard); string get_last_name(); int get_standard(); string to_string();
}; void Student :: set_standard(int standard) { class1 = standard; } void Student :: set_age(int age) { a = age; } int Student :: get_age(void) { return a; } void Student :: set_first_name(string first_name) { f = first_name; } string Student :: get_first_name(void) { return f; } void Student :: set_last_name(string last_name) { l = last_name; } string Student :: get_last_name() { return l; } int Student :: get_standard() { return class1; } string Student :: to_string() { stringstream var; var << a << "," << f << "," << l << "," << class1; return var.str(); }
int main() { int age, standard; string first_name, last_name;
}