MCPcopy Create free account
hub / github.com/Rustam-Z/cpp-programming / ValidationName

Method ValidationName

Project_E-Commerce_App_V1.0/Header.h:78–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76 }
77 //Validation Check for Name
78 friend void ValidationName(Security User) {
79 if (User.Name.length() >= 1 && User.Name.length() <= 15) {
80 for (int i = 0; i < User.Name.length(); i++) {
81 if (isupper(User.Name[i])) {
82 Num_Upper += 1;
83 }
84 if (islower(User.Name[i])) {
85 Num_Lower += 1;
86 }
87 if (isdigit(User.Name[i])) {
88 Num_Number += 1;
89 }
90 }
91
92 if (Num_Upper <= 1 && Num_Lower >= 1 && Num_Lower <= 14 && Num_Number == 0) {
93 Validation++;
94 Num_Upper = 0; Num_Lower = 0; Num_Number = 0;
95 }
96 else { Num_Upper = 0; Num_Lower = 0; Num_Number = 0; }
97 }
98 else { Num_Upper = 0; Num_Lower = 0; Num_Number = 0; }
99 }
100 //Validation Check for TellNum
101 friend void ValidationTellNum(Security User) {
102 if (User.TellNum.length() >= 9 && User.TellNum.length() <= 12) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected