Showing posts with label oops. Show all posts
Showing posts with label oops. Show all posts

Wednesday, January 5, 2011

c++ program to read STUDENT details and calculate average of 2 better marks for each student


#include
#include
using namespace std;


class student
{
private: char name[20];
int usn;
int m1,m2,m3;
float avg;
public: void read();
void show();
float average();
};

c++ Program to read data of N employees and compute Net_salary of each employee.

#include iostream
#include iomanip
using namespace std;


class employee
{
private:int num;
char name[20];
float bs,gs,da,it,net;
public: employee()
{
num=0;
name[0]='\0';
bs=da=it=net=0;
};
void read();
void show();
void calc();
};