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

74 行
1.1 KiB

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