Question: Edit the code pls #include #include #include #include #include using namespace std; #include #include #include #include using namespace std; int main(int argc, char** argv) {

Edit the code pls

#include #include #include #include #include using namespace std; #include #include #include #include using namespace std; int main(int argc, char** argv) { string filename; ifstream file; //if no file name is given if(argc==1) { cout<<"No file is found"; return 0; }

//opening the file file.open(argv[argc-1]);

//if file if not opened if(!file) { cout<< "File cannot be opened: "<

//else reading file and adding them in map

mapmp; string str; int count =0; //reading till end of the file while(getline(file,str)) {

for(int i = 0;i

//ignoring white space if(str[i]!=' ') { //if not white space adding it into map mp[str[i]]++; } }

} cout<<"List of characters seen in the file and their number of occurrences: "<='A'&&ch.first<='Z') { //if charater continue; } else if(ch.first>='0'&&ch.first<='9') { //if digit continue } else { cout<

cout<<"DIGITS: ";

for(auto ch:mp) { if(ch.first>='0'&&ch.first<='9') { cout<

//printing char cout<<" CHARACTERS "; for(auto ch:mp) { if(ch.first>='A'&&ch.first<='Z') { cout<

cout << "Number of non-alphanumeric characters seen in the file: "<

can you please also. add Print each decimal digit and letter that was seen the largest number of times on a line by itself and the number of times it was seen in the file

. for example:

Digits of Largest number of occurrences: 0:8

Digits of Largest number of occurrences: 7: 8

Letters of Largest number of occurrences: E: 10

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!