Skip to content

Commit

Permalink
adding works
Browse files Browse the repository at this point in the history
  • Loading branch information
MiKaz003 committed Aug 26, 2024
1 parent e415253 commit 6cf3023
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
1 change: 0 additions & 1 deletion homework/password-check/main.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include <iostream>
#include <string>
#include "validation.hpp"

int main() {
Expand Down
9 changes: 9 additions & 0 deletions homework/password-check/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
#include <cctype>
#include <vector>
// TODO: Put implementations here

enum class ErrorCode{
Ok,
PasswordNeedsAtLeastNineCharacters,
PasswordNeedsAtLeastOneNumber,
PasswordNeedsAtLeastOneSpecialCharacter,
PasswordNeedsAtLeastOneUppercaseLetter,
PasswordsDoNotMatch
};
bool doPasswordsMatch(std::string& pass1, std::string& pass2) {
if (pass1 == pass2) {
return true;
Expand Down
9 changes: 1 addition & 8 deletions homework/password-check/validation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,7 @@
// TODO: I'm empty :) Put enum and function headers here.
// Don't forget the header guard - #pragma once

enum class ErrorCode{
Ok,
PasswordNeedsAtLeastNineCharacters,
PasswordNeedsAtLeastOneNumber,
PasswordNeedsAtLeastOneSpecialCharacter,
PasswordNeedsAtLeastOneUppercaseLetter,
PasswordsDoNotMatch
};
enum class ErrorCode;
std::string getErrorMessage(int errorNum);
bool doPasswordsMatch(std::string& pass1, std::string& pass2);
int checkPasswordRules(std::string& pass);
Expand Down

0 comments on commit 6cf3023

Please sign in to comment.