C++ for Engineers and Scientists
C++ for Engineers and Scientists
4th Edition
ISBN: 9781133187844
Author: Bronson, Gary J.
Publisher: Course Technology Ptr
expand_more
expand_more
format_list_bulleted
Bartleby Related Questions Icon
Related questions
Question
use java
Transcribed Image Text:Part I: Write a program to compress a source file into a target file using the Huffman coding method. First,
use ObjectOutputStream to output the Huffman codes into the target file, then use BitOutputStream from Assignment
#2 to output the encoded binary contents to the target file. Pass the files from the command line using something like
the following command:
C:\Users\.... > java Compress_a_File sourceFile.txt compressedFile.txt
When I did this for my source file, I got a compressed file that looked something like the following:
í w Zur [Ljava.lang.String;ÒVçé{G xp ppppppppppt 01101ppt 11010ppppppppppppppppppt 100pppppppppppt
10101pt 1111010ppppppppppppppppppt 011000pppppppppPPPPPPpt 1010011pt 1111011pt 1101110ppppppppppt
110110t 1101111t 00000t 01111 010t 101000pt 00001t 11111ppt 01110t 00010t 00011t 1110t 111100pt 1011t
001t 1100t 011001pppt
1010010pppppppppppppppPPPPPPPPpppppppppppppppppppppppPPPPPPPPppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppw
0§Ãμiów MieWM÷ttËDÏÌ£ïUÓXæ-...gògw
Part II: Write a second program, Decompress_a_File.java, to decompress a previously compressed file so that it
replicates the original source file in Part I above. You would do this at the command line with a command that looks like
the following:
C:\Users\...> java Decompress_a_File compressedFile.txt decompressedFile.txt
When I ran this second program on my compressed file from Part I above I got:
Roses are red,
Violets are blue,
Try to compress this file,
And then decompress it too.
Expert Solution
Check MarkThis question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
bartleby
Step by stepSolved in 2 steps
Knowledge Booster
Background pattern image
Recommended textbooks for you
- Text book imageC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrText book imageMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,Text book imageEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
- Text book imageC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningText book imageProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageText book imageCOMPREHENSIVE MICROSOFT OFFICE 365 EXCEComputer ScienceISBN:9780357392676Author:FREUND, StevenPublisher:CENGAGE L
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:9780357392676
Author:FREUND, Steven
Publisher:CENGAGE L