-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCliente.cpp
More file actions
40 lines (32 loc) · 1.09 KB
/
Copy pathCliente.cpp
File metadata and controls
40 lines (32 loc) · 1.09 KB
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
32
33
34
35
36
37
38
39
40
//
// Cliente.cpp
// Progetto 1 Nunzio Depetro
//
// Created by Nuccio Depetro on 08/07/21.
//
#include "Cliente.h"
#include <stdio.h>
#include <iostream>
#include <string>
using namespace std;
ostream& operator<<(ostream& out,const Cliente& c){
out<<"("<<c.cognome<<")\t"<<c.pizza<<"\tQuantità :"<<c.quantita<<"\t Prezzo: €"<<c.prezzo_unitario<<endl;
return out;
}
string Cliente::getCognome()const{return cognome;}
void Cliente::setCognome(string cogn){cognome=cogn;}
string Cliente::getPizza()const{return pizza;}
double Cliente::getPrezzo()const{return prezzo_unitario;}
int Cliente::getQuantita()const{return quantita;}
Cliente::Cliente(){};
Cliente::Cliente(string _cognome,string _pizza,int _quantita, double _prezzo_unitario):cognome(_cognome),pizza(_pizza),quantita(_quantita),prezzo_unitario(_prezzo_unitario){}
bool Cliente::operator>(const Cliente& r)const{
return prezzo_unitario>r.getPrezzo();
}
bool Cliente::operator==(const Cliente& r)const{
return cognome==r.getCognome();
}
bool Cliente::operator!=(const Cliente& r)const{
return cognome!=r.getCognome();
}
//