12.07.2015 Views

C++ - VideoTutorials-bg.com

C++ - VideoTutorials-bg.com

C++ - VideoTutorials-bg.com

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

int get_score() const;private:char name[21];double price;int score;};Примитивните операции се реализирани чрез следните членфункции:void read();- въвежда информация за компютърvoid print() const; - извежда информация за компютърbool is_better_from(product const &) const;- проверява дали текущият компютър имапо-добро съотношение score/priceот това на указания като формаленпараметърdouble get_price() const; - намира цената на компютърint get_score() const; - намира точките на компютърПрограма Zad120.cpp решава задачата.// Program Zad120.cpp#include #include #include class product{private:char name[21];double price;int score;public:void read();void print() const;bool is_better_from(product const &) const;double get_price() const;int get_score() const;};void sorttable(int n, product* []);int main(){cout

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!