Student Class

Description:

Write a class called 'student' with Data members: name(char type), marks1, marks2 (integer type) The program asks the user to enter name and marks. Then calc_median() calculates the median marks and disp() display name and total mark and median on screen in different lines. Test Case 1 Input (stdin) Jack 60 70 Expected Output Jack 130 65 Test Case 2 Input (stdin) Mathematics 90 80 Expected Output Mathematics 170 85

Program :

#include <iostream>

using namespace std;

int main()

{

  int a,b,c,d;

  char s[100];

  cin>>s;

  cin>>a;

  cin>>b;

  c=a+b;

  d=c/2;

  cout<<s<<"\n";

  cout<<c<<"\n";

  cout<<d;

return 0;

}