subject

#include #include
#include
#include
using namespace std;
class cypher_encryptor
{
string cypher;
public:
cypher_encryptor(string cypher)
{
this->cypher = cypher;
}
string encode(string original)
{
string result = original;
for (int i = 0; i < original. length(); i++)
{
if (original[i] == ' ') continue;
result[i] = cypher[original[i] - 'a'];
}
return result;
}
string decode(string secret)
{
string result = secret;
for (int i = 0; i < secret. length(); i++)
{
if (secret[i] == ' ') continue;
for (int j = 0; j <= 26; j++)
{
if (cypher[j] == secret[i])
{
result[i] = j + 'a';
}
}
}
return result;
}
};
class hacker
{
//Returns for each character the number of times it appears in the string
map* count_letters(string phrase)
{
// Your code starts here
// Your code ends here
}
//Returns for each count the characters that appears that number of times in the string
map>* by_counts(map counts)
{
// Your code starts here
// Your code ends here
}
public:
//Calculates the cypher using phrase as a reference and encoded
string get_cypher(string phrase, string encoded)
{
// Your code starts here
// Your code ends here
}
};
//After

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 13:20
Arectangular room is 4 meters longer than it is wide and its preimeter is 32 meters find the dimensions of the room
Answers: 3
question
Computers and Technology, 21.06.2019 16:00
Answer me pls is an algorithm that has been coded into something that can be run by a machine.
Answers: 3
question
Computers and Technology, 21.06.2019 22:00
You should try to photograph people on bright sunny days because the light will be best a) true b) false
Answers: 1
question
Computers and Technology, 22.06.2019 11:00
What are two of the most common reasons that peolpe who need mental health care do not access it?
Answers: 1
You know the right answer?
#include #include
#include
#include
using namespace std;
class cypher_en...
Questions
Questions on the website: 13722367