-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomponente.h
More file actions
33 lines (26 loc) · 855 Bytes
/
componente.h
File metadata and controls
33 lines (26 loc) · 855 Bytes
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
//Autore: Edoardo Bastianello , numero matricola: 1188629
//header "componente.h
#ifndef componenteH
#define componenteH
#include <vector>
#include <iostream>
class componente{
public:
//costruttore vuoto non ammesso
//costruttore: alla creazione vengono settati l'id, il nome, i mesi necessari per l'invio e i 3 prezzi (per l'acquisto di 1-10, 11-50 e 51+ pezzi)
componente(std::string id, std::string nome, int mesi, std::vector<double> prezzi);
componente();
//funzioni di lettura
std::string getId()const;
std::string getNome()const;
int getMesi()const;
//ritorna -1 se le viene fornito come parametro un valore <0
double getPrezzo(int pezzi)const;//ritorna il prezzo in base al numero di pezzi
private:
//dati membro
std::string id {""};
std::string nome {""};
int mesi {1};
std::vector <double> prezzi {0,0,0};
};
#endif