#include "LoginDetails.h" string LoginDetails::masterPassword = "please"; string LoginDetails::defaultPassword = "defaultPassword"; LoginDetails::LoginDetails(const string & username, const string & password) : username(username), password(password) { // This statement fails to compile - can't modify const data member. // this->username = username; } void LoginDetails::Display() const { cout << "Username: " << username << ", password: " << password << endl << endl; } bool LoginDetails::ChangePassword(const string & oldPassword, const string & newPassword) { if (oldPassword == password) { password = newPassword; return true; } else { return false; } } void LoginDetails::DisplayClassPasswords() { cout << "Class-wide passwords: " << endl; cout << "Master password: " << masterPassword << endl; cout << "Default password: " << defaultPassword << endl; }