encrypt() {
for (let i = 0; i < this.text_length; i++) {
let char = this.plain_text[i].toUpperCase();
if (char === " ") {
this.encrypted_string += char;
} else {
let location = this.alphabet.indexOf(char);
let new_location = (location + this.shift) % 26;
this.encrypted_string += this.alphabet[new_location];
}
}
return this.encrypted_string;
}
encrypt() {
for (let i = 0; i < this.text_length; i++) {
let char = this.plain_text[i].toUpperCase();
if (char === " ") {
this.encrypted_string += char;
} else {
let location = this.alphabet.indexOf(char);
let new_location = (location + this.shift) % 26;
this.encrypted_string += this.alphabet[new_location];
}
}
return this.encrypted_string;
}