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
//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 map 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: "< 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
Get step-by-step solutions from verified subject matter experts
