25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

Person.cpp 1.0 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * Written by : BinHong Lee
  3. * Last edited : 5/11/2016
  4. */
  5. #include <string>
  6. #include "Person.hpp"
  7. using namespace std;
  8. //Empty constructor
  9. Person::Person()
  10. {
  11. }
  12. //Complete comstructor
  13. Person::Person(string name, string password, string email, string phoneNo, int id)
  14. {
  15. this->name = name;
  16. this->password = password;
  17. this->email = email;
  18. this->phoneNo = phoneNo;
  19. this->id = id;
  20. }
  21. //Getters and setters
  22. void Person::setName(string name)
  23. {
  24. this->name = name;
  25. }
  26. string Person::getName()
  27. {
  28. return name;
  29. }
  30. void Person::setEmail(string email)
  31. {
  32. this->email = email;
  33. }
  34. string Person::getEmail()
  35. {
  36. return email;
  37. }
  38. void Person::setPhoneNo(string phoneNo)
  39. {
  40. this->phoneNo = phoneNo;
  41. }
  42. string Person::getPhoneNo()
  43. {
  44. return phoneNo;
  45. }
  46. void Person::setPassword(string password)
  47. {
  48. this->password = password;
  49. }
  50. string Person::getPassword()
  51. {
  52. return password;
  53. }
  54. //"password" do not have getter but only a checker instead
  55. bool Person::checkPassword(string password)
  56. {
  57. return (this->password == password);
  58. }
  59. int Person::getId()
  60. {
  61. return id;
  62. }