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, 22.06.2019 22:20
Pp 4.1 design and implement a class called sphere that contains instance data that represents the sphere’s diameter. define the sphere constructor to accept and initialize the diameter and include getter and setter methods for the diameter. include methods that calculate and return the volume and surface area of the sphere (see pp 3.5 for the formulas). include a tostring method that returns a one-line description of the sphere. create a driver class called multisphere, whose main method instantiates and updates several sphere objects.
Answers: 1
question
Computers and Technology, 23.06.2019 12:40
Curriculum exam to process a resident's payment, you must click on onesite payments home page. from the a. reports b. my settings o c.transactions o d. rent tab
Answers: 1
question
Computers and Technology, 24.06.2019 09:00
Technician a says that a new replacement part is always good. technician b says that sometimes recent repair work will be the cause of a complaint. who is correct? a. both technicians a and b b. technician a c. technician b d. neither technician a nor b
Answers: 3
question
Computers and Technology, 24.06.2019 13:30
In the rgb model, which color is formed by combining the constituent colors? a) black b) brown c) yellow d) white e) blue
Answers: 1
You know the right answer?
#include #include
#include
#include
using namespace std;
class cypher_en...
Questions
Questions on the website: 13722361