C++ Please read the txt below: Character[ ] = Frequency[ 7060 ] # space character Character[ ! ] = Frequency[ 14 ] Character[ " ] = Frequency[ 46 ] Character[ # ] = Frequency[ 0 ] Character[ $ ] = Frequency[ 2 ] Character[ % ] = Frequency[ 0 ] Character[ & ] = Frequency[ 0 ] Character[ ' ] = Frequency[ 53 ] Character[ ( ] = Frequency[ 17 ] Character[ ) ] = Frequency[ 16 ] Character[ * ] = Frequency[ 0 ] Character[ + ] = Frequency[ 0 ] Character[ , ] = Frequency[ 372 ] Character[ - ] = Frequency[ 31 ] Character[ . ] = Frequency[ 271 ] Character[ / ] = Frequency[ 9 ] Character[ 0 ] = Frequency[ 80 ] Character[ 1 ] = Frequency[ 33 ] Character[ 2 ] = Frequency[ 18 ] Character[ 3 ] = Frequency[ 3 ] Character[ 4 ] = Frequency[ 10 ] Character[ 5 ] = Frequency[ 18 ] Character[ 6 ] = Frequency[ 3 ] Character[ 7 ] = Frequency[ 0 ] Character[ 8 ] = Frequency[ 1 ] Character[ 9 ] = Frequency[ 2 ] Character[ : ] = Frequency[ 9 ] Character[ ; ] = Frequency[ 50 ] Character[ < ] = Frequency[ 0 ] Character[ = ] = Frequency[ 0 ] Character[ > ] = Frequency[ 0 ] Character[ ? ] = Frequency[ 49 ] Character[ @ ] = Frequency[ 0 ] Character[ A ] = Frequency[ 40 ] Character[ B ] = Frequency[ 34 ] Character[ C ] = Frequency[ 8 ] Character[ D ] = Frequency[ 5 ] Character[ E ] = Frequency[ 14 ] Character[ F ] = Frequency[ 10 ] Character[ G ] = Frequency[ 1 ] Character[ H ] = Frequency[ 20 ] Character[ I ] = Frequency[ 144 ] Character[ J ] = Frequency[ 2 ] Character[ K ] = Frequency[ 1 ] Character[ L ] = Frequency[ 15 ] Character[ M ] = Frequency[ 8 ] Character[ N ] = Frequency[ 15 ] Character[ O ] = Frequency[ 9 ] Character[ P ] = Frequency[ 15 ] Character[ Q ] = Frequency[ 0 ] Character[ R ] = Frequency[ 8 ] Character[ S ] = Frequency[ 14 ] Character[ T ] = Frequency[ 76 ] Character[ U ] = Frequency[ 5 ] Character[ V ] = Frequency[ 4 ] Character[ W ] = Frequency[ 58 ] Character[ X ] = Frequency[ 0 ] Character[ Y ] = Frequency[ 10 ] Character[ Z ] = Frequency[ 0 ] Character[ [ ] = Frequency[ 0 ] Character[ \ ] = Frequency[ 0 ] Character[ ] ] = Frequency[ 0 ] Character[ ^ ] = Frequency[ 0 ] Character[ _ ] = Frequency[ 0 ] Character[ ` ] = Frequency[ 0 ] Character[ a ] = Frequency[ 2475 ] Character[ b ] = Frequency[ 420 ] Character[ c ] = Frequency[ 985 ] Character[ d ] = Frequency[ 857 ] Character[ e ] = Frequency[ 3587 ] Character[ f ] = Frequency[ 644 ] Character[ g ] = Frequency[ 525 ] Character[ h ] = Frequency[ 1675 ] Character[ i ] = Frequency[ 2127 ] Character[ j ] = Frequency[ 23 ] Character[ k ] = Frequency[ 184 ] Character[ l ] = Frequency[ 1407 ] Character[ m ] = Frequency[ 911 ] Character[ n ] = Frequency[ 1953 ] Character[ o ] = Frequency[ 2419 ] Character[ p ] = Frequency[ 531 ] Character[ q ] = Frequency[ 42 ] Character[ r ] = Frequency[ 1592 ] Character[ s ] = Frequency[ 1938 ] Character[ t ] = Frequency[ 2968 ] Character[ u ] = Frequency[ 874 ] Character[ v ] = Frequency[ 292 ] Character[ w ] = Frequency[ 605 ] Character[ x ] = Frequency[ 58 ] Character[ y ] = Frequency[ 612 ] Character[ z ] = Frequency[ 45 ] Character[ { ] = Frequency[ 0 ] Character[ | ] = Frequency[ 0 ] Character[ } ] = Frequency[ 0 ] Character[ ~ ] = Frequency[ 0 ] Character[ ] = Frequency[ 0 ] Character[ ] = Frequency[ 0 ] The output should be store in tuple : tuple tletter with char is A, B, C, …. int is the number of frequency string will be 010101 (binary equivalence)
C++
Please read the txt below:
Character[ ] = Frequency[ 7060 ] # space character
Character[ ! ] = Frequency[ 14 ]
Character[ " ] = Frequency[ 46 ]
Character[ # ] = Frequency[ 0 ]
Character[ $ ] = Frequency[ 2 ]
Character[ % ] = Frequency[ 0 ]
Character[ & ] = Frequency[ 0 ]
Character[ ' ] = Frequency[ 53 ]
Character[ ( ] = Frequency[ 17 ]
Character[ ) ] = Frequency[ 16 ]
Character[ * ] = Frequency[ 0 ]
Character[ + ] = Frequency[ 0 ]
Character[ , ] = Frequency[ 372 ]
Character[ - ] = Frequency[ 31 ]
Character[ . ] = Frequency[ 271 ]
Character[ / ] = Frequency[ 9 ]
Character[ 0 ] = Frequency[ 80 ]
Character[ 1 ] = Frequency[ 33 ]
Character[ 2 ] = Frequency[ 18 ]
Character[ 3 ] = Frequency[ 3 ]
Character[ 4 ] = Frequency[ 10 ]
Character[ 5 ] = Frequency[ 18 ]
Character[ 6 ] = Frequency[ 3 ]
Character[ 7 ] = Frequency[ 0 ]
Character[ 8 ] = Frequency[ 1 ]
Character[ 9 ] = Frequency[ 2 ]
Character[ : ] = Frequency[ 9 ]
Character[ ; ] = Frequency[ 50 ]
Character[ < ] = Frequency[ 0 ]
Character[ = ] = Frequency[ 0 ]
Character[ > ] = Frequency[ 0 ]
Character[ ? ] = Frequency[ 49 ]
Character[ @ ] = Frequency[ 0 ]
Character[ A ] = Frequency[ 40 ]
Character[ B ] = Frequency[ 34 ]
Character[ C ] = Frequency[ 8 ]
Character[ D ] = Frequency[ 5 ]
Character[ E ] = Frequency[ 14 ]
Character[ F ] = Frequency[ 10 ]
Character[ G ] = Frequency[ 1 ]
Character[ H ] = Frequency[ 20 ]
Character[ I ] = Frequency[ 144 ]
Character[ J ] = Frequency[ 2 ]
Character[ K ] = Frequency[ 1 ]
Character[ L ] = Frequency[ 15 ]
Character[ M ] = Frequency[ 8 ]
Character[ N ] = Frequency[ 15 ]
Character[ O ] = Frequency[ 9 ]
Character[ P ] = Frequency[ 15 ]
Character[ Q ] = Frequency[ 0 ]
Character[ R ] = Frequency[ 8 ]
Character[ S ] = Frequency[ 14 ]
Character[ T ] = Frequency[ 76 ]
Character[ U ] = Frequency[ 5 ]
Character[ V ] = Frequency[ 4 ]
Character[ W ] = Frequency[ 58 ]
Character[ X ] = Frequency[ 0 ]
Character[ Y ] = Frequency[ 10 ]
Character[ Z ] = Frequency[ 0 ]
Character[ [ ] = Frequency[ 0 ]
Character[ \ ] = Frequency[ 0 ]
Character[ ] ] = Frequency[ 0 ]
Character[ ^ ] = Frequency[ 0 ]
Character[ _ ] = Frequency[ 0 ]
Character[ ` ] = Frequency[ 0 ]
Character[ a ] = Frequency[ 2475 ]
Character[ b ] = Frequency[ 420 ]
Character[ c ] = Frequency[ 985 ]
Character[ d ] = Frequency[ 857 ]
Character[ e ] = Frequency[ 3587 ]
Character[ f ] = Frequency[ 644 ]
Character[ g ] = Frequency[ 525 ]
Character[ h ] = Frequency[ 1675 ]
Character[ i ] = Frequency[ 2127 ]
Character[ j ] = Frequency[ 23 ]
Character[ k ] = Frequency[ 184 ]
Character[ l ] = Frequency[ 1407 ]
Character[ m ] = Frequency[ 911 ]
Character[ n ] = Frequency[ 1953 ]
Character[ o ] = Frequency[ 2419 ]
Character[ p ] = Frequency[ 531 ]
Character[ q ] = Frequency[ 42 ]
Character[ r ] = Frequency[ 1592 ]
Character[ s ] = Frequency[ 1938 ]
Character[ t ] = Frequency[ 2968 ]
Character[ u ] = Frequency[ 874 ]
Character[ v ] = Frequency[ 292 ]
Character[ w ] = Frequency[ 605 ]
Character[ x ] = Frequency[ 58 ]
Character[ y ] = Frequency[ 612 ]
Character[ z ] = Frequency[ 45 ]
Character[ { ] = Frequency[ 0 ]
Character[ | ] = Frequency[ 0 ]
Character[ } ] = Frequency[ 0 ]
Character[ ~ ] = Frequency[ 0 ]
Character[ ] = Frequency[ 0 ]
Character[ ] = Frequency[ 0 ]
The output should be store in tuple : tuple<char,int,string> tletter
with char is A, B, C, ….
int is the number of frequency
string will be 010101 (binary equivalence)
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 4 images