Guest User

Untitled

a guest
Dec 27th, 2010
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.09 KB | None | 0 0
  1. #include "Cell.h"
  2.  
  3. Cell::Cell(string name,int price,string design,string touch)
  4. {
  5.     this->name=name;
  6.     this->price=price;
  7.     this->design=design;
  8.     this->touch=touch;
  9. }
  10.  
  11. Cell::Cell()
  12. {
  13.     this->name="Unknown";
  14.     this->price=0;
  15.     this->design="Unknown";
  16.     this->touch="Unknown";
  17. }
  18.  
  19. string Cell::getDesign()
  20. {
  21.     return this->design;
  22. }
  23.  
  24. string Cell::getName()
  25. {
  26.     return this->name;
  27. }
  28.  
  29. string Cell::getTouch()
  30. {
  31.     return this->touch;
  32. }
  33.  
  34. int Cell::getPrice()
  35. {
  36.     return this->price;
  37. }
  38.  
  39. void Cell::SetPrice(int price)
  40. {
  41.     this->price=price;
  42. }
  43.  
  44. void Cell::setDesign(string design)
  45. {
  46.     this->design=design;
  47. }
  48.  
  49. void Cell::setTouch(string touch)
  50. {
  51.     this->touch=touch;
  52. }
  53.  
  54. void Cell::setName(string name)
  55. {
  56.     this->name=name;
  57. }
  58.  
  59. void Cell::show()
  60. {
  61.     cout<<"Modell: "<<this->name<<" Design: "<<this->design<<" Touch: "<<this->touch<<" Pris: "<<this->price<<endl;
  62. }
  63.  
  64. void Cell::showTouch()
  65. {
  66.     cout<<this->name;
  67. }
  68.  
  69. void Cell::showDesign()
  70. {
  71.     cout<<this->name<<" är "<<this->design;
  72. }
  73.  
  74. bool Cell::operator<(Cell cell1)
  75. {
  76.      return (this->name[0]< cell1.name[0]);
  77. }
Advertisement
Add Comment
Please, Sign In to add comment