All pastes #2076485 Raw Edit

Someone

public text v1 · immutable
#2076485 ·published 2011-06-08 00:55 UTC
rendered paste body

using namespace std;

class student: public osoba
	{
	string kierunek;
	int rok;
	double zarobki;
	
	public:
	student();
	student(string,string,int,double,int,string.double);
	void set_values(string,string,int,double,int,string,int,double);
	void wypisz();

	friend bool wg_kierunek(osoba,osoba);	
	friend bool wg_rok(osoba,osoba);
	friend bool wg_stypendium(osoba,osoba);
	};

//--------------------konstruktor-bezargumentowy-------------------------------------------------//

student::student()
	{
	imie="...";
	nazwisko="...";
	rok=0;
	kierunek="...";	
	stypendium="...";
	}

//--------------------konstruktor-5-argumentowy--------------------------------------------------//

osoba::student(string imie1,string nazwisko1,int rok1,string kierunek1, string stypendium1)
	{
	imie=imie1;
	nazwisko=nazwisko1;
	rok=rok1;	
	kierunek=kierunek1;	
	stypendium=stypendium1;
	}

//--------------------metoda-set_values()--------------------------------------------------------//

void student::set_values(string imie1, string nazwisko1, int rok1, string kierunek1, double stypendium1)
	{
	imie=imie1;
	nazwisko=nazwisko1;
	wiek=wiek1;
	zarobki=zarobki1;
	}

//--------------------metoda-wypisz()------------------------------------------------------------//

void student::wypisz()
	{
	cout << "| " << setw(13) << left << imie << " ";
	cout << "| " << setw(13) << left << nazwisko << " ";
	cout << "| " << setw(13) << right << wiek << " ";
	cout << "| " << setw(13) << fixed << setprecision(2) << right << zarobki << " |";
	cout << "| " << setw(13) << left << rok << " ";
	cout << "| " << setw(13) << left << kierunek << " ";
	cout << "| " << setw(13) << right << stypendium << " ";
	cout << endl;
	}

//--------------------sortowanie-wg-kierunku------------------------------------------------------//

bool wg_kierunek(student A, student B)
	{
	if(A.imie<B.imie) return true;
	return false;
	}

//--------------------sortowanie-wg-roku-----------------------------------------------------//

bool wg_rok(student A, student B)
	{
	if(A.nazwisko<B.nazwisko) return true;
	return false;
	}

//--------------------sortowanie-wg-stypendium--------------------------------------------------------//

bool wg_stypendium(student A, student B)
	{
	if(A.stypendium<B.stypendium) return true;
	return false;
	}