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

64 行
985 B

  1. /*
  2. * Written by : BinHong Lee
  3. * Last edited : 4/22/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. void Person::setPassword(string password)
  46. {
  47. this->password = password;
  48. }
  49. //"password" do not have getter but only a checker instead
  50. bool Person::checkPassword(string password)
  51. {
  52. return (this->password == password);
  53. }