Student Details

Description:

You have to create a class, named Student, representing the student's age (int), first_name (string), last_name (string), standard (int) and store the data of a student. Create setter and getter functions for each element; that is, the class should at least have following functions: get_age, set_age, get_first_name, set_first_name, get_last_name, set_last_name, get_standard, set_standard. Input Format: Input will consist of four lines. 1.The first line will contain an integer, representing the age. 2.The second line will contain a string, consisting of lower-case Latin characters ('a'-'z'), representing the first_name of a student. 3.The third line will contain another string, consisting of lower-case Latin characters ('a'-'z'), representing the last_name of a student. 4.The fourth line will contain an integer, representing the standard of student. Note: The number of characters in first_name and last_name will not exceed 50. Test Case 1 Input (stdin) 15 john carmack 10 Expected Output 15 carmack,john 10 Test Case 2 Input (stdin) 10 Siva Rajendar 6 Expected Output 10 Rajendar,Siva 6

Program :

#include <iostream>

using namespace std;

int main()

{

   int n;

  cin>>n;

  cout<<n<<"\n";

  char s[100],d[100];

  cin>>s;

  cin>>d;

  cout<<d<<","<<s<<"\n";

  int a;

  cin>>a;cout<<a;

return 0;

}