Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- using namespace std;
- class Proizvod{
- private:
- char ime[20];
- int sif_pr;
- int kolicina;
- int cena;
- public:
- Proizvod(){}//default constructor
- //constructor with arguments
- Proizvod(char ime[], int sif_pr, int kolicina, int cena){
- strcpy(this->ime,ime);
- this->sif_pr=sif_pr;
- this->kolicina=kolicina;
- this->cena=cena;
- }
- void setIme(char ime[]){
- strcpy(this->ime,ime);
- }
- void setSifra(int sif_pr){
- this->sif_pr=sif_pr;
- }
- void setKolicina(int kolicina){
- this->kolicina=kolicina;
- }
- void setCena(int cena){
- this->cena=cena;
- }
- char *getIme(){
- return ime;
- }
- int getSifra(){
- return sif_pr;
- }
- int getKolicina(){
- return kolicina;
- }
- int getCena(){
- return cena;
- }
- void print(){
- cout<<ime<<" "<<sif_pr<<" "<<kolicina<<" "<<cena<<endl;
- }
- ~Proizvod(){}//default destructor
- };
- int main(){
- Proizvod prodavnica[100];
- //do tuka ja razbrav zadacata, pojme namem za mainov posto nas ni e vekje daden pri polaganje,
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement