Consider this the word is feather remove duplicate letters


The caeser cipher, which shifts all letters by a certain amount, is easy to decipher. Try this, instead of numbers use letters. Consider this, the word is FEATHER. Remove duplicate letters, making FEATHR, and append the rest of the letters of the alphabet in reverse order.

Now encrypt the letters as follows:

Now, write a program that encrypts or decrypts a file using this cipher.

For example,

crypt -d -kFEATHER encrypt.txt output.txt
decrypts a file using the keyword FEATHER. You must always supply a keyword.

This is what I have so far:

#include
#include
#include

using namespace std;
string rem_Duplicate(string str1)
{
string str2;
int pos;
for (int i = 0; i < str1.length(); i++)
{
if ((pos = str2.find(str1[i])) < 0)
str2 += str1[i];
}
cout << str2 << endl;
return str2;
}

int main()
{
ofstream output_file;
ifstream input_file("output.txt");
output_file.open("input.txt");
string FEATHER;
string key = FEATHER;
cout << "Enter the Key: ";
cin >> key;
key = rem_Duplicate(key);

input_file.close();
output_file.close();

cin.clear();
cin.ignore();
cin.get();

return 0;

Solution Preview :

Prepared by a verified Expert
Programming Languages: Consider this the word is feather remove duplicate letters
Reference No:- TGS01245647

Now Priced at $20 (50% Discount)

Recommended (95%)

Rated (4.7/5)