選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

Person.cpp 1.1 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(int id)
  10. {
  11. this->id = id;
  12. }
  13. //Complete comstructor
  14. Person::Person(string name, string password, string email, string phoneNo, int id)
  15. {
  16. this->name = name;
  17. this->password = password;
  18. this->email = email;
  19. this->phoneNo = phoneNo;
  20. this->id = id;
  21. }
  22. //Getters and setters
  23. void Person::setName(string name)
  24. {
  25. this->name = name;
  26. }
  27. string Person::getName()
  28. {
  29. return name;
  30. }
  31. void Person::setEmail(string email)
  32. {
  33. this->email = email;
  34. }
  35. string Person::getEmail()
  36. {
  37. return email;
  38. }
  39. void Person::setPhoneNo(string phoneNo)
  40. {
  41. this->phoneNo = phoneNo;
  42. }
  43. string Person::getPhoneNo()
  44. {
  45. return phoneNo;
  46. }
  47. void Person::setPassword(string password)
  48. {
  49. this->password = password;
  50. }
  51. string Person::getPassword()
  52. {
  53. return password;
  54. }
  55. //"password" do not have getter but only a checker instead
  56. bool Person::checkPassword(string password)
  57. {
  58. return (this->password == password);
  59. }
  60. int Person::getId()
  61. {
  62. return id;
  63. }