-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStudenti.cpp
executable file
·31 lines (23 loc) · 1.25 KB
/
Studenti.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <iostream>
#include <string>
#include "Studenti.h"
using namespace std;
//Inizializzazione del'Overloading
ostream& operator << (ostream& out, const Studenti& st)
{
out << " --> ";
out << " ( " << st.matricola << " )\t " << st.cognome << "\t " << st.nome << "\t Citta': " << st.citta << "\t Media: " << st.voti << endl;
return out;
}
//Inizializzazione delle funzioni 'get'
string Studenti :: getMatricola() const { return matricola; }
string Studenti :: getCognome() const { return cognome; }
string Studenti :: getNome() const { return nome; }
string Studenti :: getCitta() const { return citta; }
float Studenti :: getVoti() const { return voti; }
Studenti :: Studenti() {};
Studenti :: Studenti(string _matricola,string _cognome,string _nome, string _citta, float _voti) : matricola(_matricola), cognome(_cognome), nome(_nome), citta(_citta), voti(_voti) {}
bool Studenti :: operator > (const Studenti& st) const { return voti > st.getVoti(); }
bool Studenti :: operator == (const Studenti& st) const { return voti == st.getVoti(); }
bool Studenti :: operator != (const Studenti& st) const { return voti != st.getVoti(); }
bool Studenti :: operator < ( const Studenti& st) const { return voti < st.getVoti(); }