Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<string.h>
- using namespace std;
- class Produkt{
- private:
- int cena;
- char ime[20];
- public:
- static int popust;
- static int ID;
- Produkt(int cena1=0,char *ime1=""){
- cena=cena1;
- strcpy(ime,ime1);
- ID++;
- }
- ~Produkt(){
- ID--;
- }
- void pecati(){
- cout<<ime<<" "<<cena<<endl;
- }
- static void setPopust(int popust1){
- popust=popust1;
- }
- float getCena(){
- return cena-cena*popust/100.0;
- }
- int getID(){
- return ID;
- }
- static int presmetka(int broj,int broj2){
- return broj2-broj;
- }
- };
- int presmetka(int broj,int broj2){
- return broj2-broj;
- }
- int Produkt::popust=5;
- int Produkt::ID=0;
- int main(){
- cout<<Produkt::presmetka(3,10);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement