2023 If you were to encrypt a file using the cipher of Exercise P9 2 the letters will | Assignment Collections

Computer Science 2023 C++ help

2023 If you were to encrypt a file using the cipher of Exercise P9 2 the letters will | Assignment Collections

If you were to encrypt a file using the cipher of Exercise P9.2, the letters will mixed up, and will appear as that you cannot decrypt it without the keyword. Also, it would seem illogical to try and guess the keyword, but someone who is trained in decryption would have no trouble breaking the cipher. The average letter frequencies of English letters are common knowledge. The most common letter E, occurs about 13% of the time.
 

  1. See Exhibit B.
  2. Write a program that reads as an input file and shows the letter frequencies in the file. This tool is invaluable to a code breaker. If the most frequent letters are H and K there is a high probability that they are the encryptions of E and T.

I have this code

 

#include<iostream>
#include<fstream>
#include<string>
using namespace std;
void count_frequencies(string str,int list[],int size)
{
    for(int i=0; i<str.length(); i++)
   {
       if(str[i]>=’A’ && str[i]<=’Z’)
       list[str[i]-‘A’]++;
       else if(str[i]>=’a’ && str[i]<=’z’)
       list[str[i]-‘a’]++;
       else continue;
   }
}
int main()
{
   ifstream infile;
   string file_name;
   int list[26] = { 0 };
   string str;
   cout <<“Enter file name to letter frequencies in the file. :”;
   cin >> file_name; cout << endl;
    infile.open(file_name.c_str());
   if(!infile)
   {
       cout <<“Unable to open file . So Exiting from program :” << endl;
       return 0;
   }
   while(!infile.eof())
   {
       infile >> str;
       count_frequencies(str,list, 26);
   }
    infile.close();
   cout <<“Letter t Count ” << endl;
   int max = list[0];
   for(int i=0; i<26; i++)
   {
   cout << static_cast<char> (i+’a’) <<” t ” << list[i] << endl;
   if(list[i] > max ) max = list[i];
   }
   cout <<“Most occured letter is ” << static_cast<char> (max+’a’) << endl;
    cout << “So E is Encrypted to ” << static_cast<char> (max+’a’) << endl;
   //system(“pause”);
   return 0;
}

 

but it does not work correclty.I need this ASAP

 

We give our students 100% satisfaction with their assignments, which is one of the most important reasons students prefer us to other helpers. Our professional group and planners have more than ten years of rich experience. The only reason is that we have successfully helped more than 100000 students with their assignments on our inception days. Our expert group has more than 2200 professionals in different topics, and that is not all; we get more than 300 jobs every day more than 90% of the assignment get the conversion for payment.

Place Order Now

#write essay #research paper #blog writing #article writing #academic writer #reflective paper #essay pro #types of essays #write my essay #reflective essay #paper writer #essay writing service #essay writer free #essay helper #write my paper #assignment writer #write my essay for me #write an essay for me #uk essay #thesis writer #dissertation writing services #writing a research paper #academic essay #dissertation help #easy essay #do my essay #paper writing service #buy essay #essay writing help #essay service #dissertation writing #online essay writer #write my paper for me #types of essay writing #essay writing website #write my essay for free #reflective report #type my essay #thesis writing services #write paper for me #research paper writing service #essay paper #professional essay writers #write my essay online #essay help online #write my research paper #dissertation writing help #websites that write papers for you for free #write my essay for me cheap #pay someone to write my paper #pay someone to write my research paper #Essaywriting #Academicwriting #Assignmenthelp #Nursingassignment #Nursinghomework #Psychologyassignment #Physicsassignment #Philosophyassignment #Religionassignment #History #Writing #writingtips #Students #universityassignment #onlinewriting #savvyessaywriters #onlineprowriters #assignmentcollection #excelsiorwriters #writinghub #study #exclusivewritings #myassignmentgeek #expertwriters #art #transcription #grammer #college #highschool #StudentsHelpingStudents #studentshirt #StudentShoe #StudentShoes #studentshoponline #studentshopping #studentshouse #StudentShoutout #studentshowcase2017 #StudentsHub #studentsieuczy #StudentsIn #studentsinberlin #studentsinbusiness #StudentsInDubai #studentsininternational