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.
please anyone tell where is my error in this code ,,,, i tell you in ss<
include
include
using namespace std;
/*
Enter code for class Student here.
Read statement for specification.
*/
class student {
private:
int age;
string first_name;
string last_name;
int standard;
public:
int a ,st;
string first,last;
void set_data(int a , string first , string last , int st){
age = a;
first_name = first;
last_name = last;
standard = st;
}
int get_age(){
return age;
}
string get_first(){
return first_name;
}
string get_last(){
return last_name ;
}
int get_st(){
return standard;
}
string addall(){
stringstream ss;
ss<>addedstring;
return addedstring;
/*
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();
please anyone tell where is my error in this code ,,,, i tell you in ss<
include
include
using namespace std;
/* Enter code for class Student here. Read statement for specification. */ class student { private: int age; string first_name; string last_name; int standard; public: int a ,st; string first,last; void set_data(int a , string first , string last , int st){ age = a; first_name = first; last_name = last; standard = st; } int get_age(){ return age; } string get_first(){ return first_name; } string get_last(){ return last_name ; } int get_st(){ return standard; } string addall(){ stringstream ss; ss<>addedstring; return addedstring;
}; int main() {
student A; cin>>A.a; cin>>A.first; cin>>A.last; cin>>A.st; A.set_data(A.a, A.first, A.last, A.st); cout<
i am getting ssame output as expected output but after that also it is showing wrong answer please help why?
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;
}