user the name of a binary or text file and a desired one Queries the number of bytes and then outputs this number of bytes from the file. ->The content of ten bytes in each line should first be output in hexadecimal and then decoded according to the ASCII table. For the ASCII string, make sure that the control characters in the file do not interfere with the formatting of the output. In the examples below, for example, a Tabulator as '¬' (\ xaa) and a line break as '╗' (\ xbb). -> The program should differentiate between binary and text files based on the file extension .txt. -> Functionality and required formatting can be seen in the two following examples.
C++:HexDump: Hello i need help with this task:
I need a working code.
Write a program that gives the user the name of a binary or text file and a desired one Queries the number of bytes and then outputs this number of bytes from the file.
->The content of ten bytes in each line should first be output in hexadecimal and then decoded according to the ASCII table. For the ASCII string, make sure that the control characters in the file do not interfere with the formatting of the output. In the examples below, for example, a Tabulator as '¬' (\ xaa) and a line break as '╗' (\ xbb).
-> The program should differentiate between binary and text files based on the file extension .txt.
-> Functionality and required formatting can be seen in the two following examples.
tabeltennis.dta
TSV Auerbach @ V TV Buerstadt X : SV Crumstadt II l $ $ TSV Ernsthofen D S TSV Hoechst II [ 0 TTC Langen-Brombach < ^ SV Moerlenbach II 5 Z DJK/Scc Pfungstadt O N TV Seeheim e TV Stockheim W 6
buildings.txt
"64846 Gross-Zimmern Waldstr. 5" 1600000 25000 1 "Waldhotel" ***
"64846 Gross-Zimmern Holzstr. 25" 10000000 4000000 2 2000 20
"48163 Muenster Untietheide 2" 1200000 45000 1 "Landhaus Kahl" ****
"70567 Stuttgart Richterstr. 23" 1000000 15000 1 "Hotel Koerschtal" ***
"64807 Dieburg Lagerstr. 3" 5000000 2100000 2 1500 24
"64807 Dieburg Zuckerstr. 3" 6000000 3100000 2 1900 33
"64807 Dieburg Markt 22" 1200000 23000 1 "Mainzer Hof" ***
"64295 Darmstadt Rheinstr. 105" 3300000 63000 1 "Maritim" *****
"64295 Darmstadt Rheinstr. 75" 5000000 2700000 2 1200 36
"64293 Darmstadt Bleichstr. 48" 9000000 23000 1 "Prinz Heinrich" **
"64293 Darmstadt Kasinostr. 48" 9500000 23000 2 1200 23
"64846 Gross-Zimmern Stadtstr. 3" 1400000 25000 1 "Stadthotel" ***
"64846 Gross-Zimmern Holzweg 42" 8000000 4000000 2 1800 22
"48163 Muenster Bahnhofstr. 27" 1800000 16000 1 "Zum Bahnhof" **
"70567 Stuttgart Henkerstr. 16" 1100000 15000 1 "Hotel Kirschbluete" ***
"64807 Dieburg Industriestr. 23" 5000000 210000 2 1230 21
"64807 Dieburg Salzstr. 36" 7000000 3100000 2 1950 31
"64807 Dieburg Markt 22" 1300000 23000 1 "Schwarzer Loewe" ***
"64295 Darmstadt Rheinstr. 98" 3800000 63000 1 "Maritim Kongress" *****
"64295 Darmstadt Rhausstr. 110" 8500000 2700000 2 1800 34
"64293 Darmstadt Heinerstr. 78" 8500000 23000 1 "Kaiserhof" ****
"64293 Darmstadt Kasinostr. 56" 7500000 23000 2 1100 30
"64846 Gross-Zimmern Pilsweg 108" 7500000 4000000 2 2200 23
Step by step
Solved in 2 steps with 9 images