Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Must be Python. All i need help with is writing tFor this HW , students will complete the first 6 methods on page 3 of
Must be Python. All i need help with is writing tFor this HW students will complete the first methods on page of the & document.
tohexstring
countruns
encoderle
getdecodedlength
decoderle
stringtodata
They must match specifications and pass the given test cases, which will be your means of submission for this part of the assignment.
To guarantee functionality moving forward to HW you are expected to receive full marks for this section.
Note: In this HWB you don't need to implement the functionality of the main method. We will use unit testing to test each of these six functions. Please write your unit tests before your submission.
Class Methods
Student classes are required to provide all of the following methods with defined behaviors. We recommend completing them in the following order:
tohexstring data
Translates data RLE or raw a hexadecimal string without delimiters This method can also aid debugging. Ex: tohexstring yields string f
countrunsflatdata
Retums number of runs of data in an image data set; double this result for length of encoded RLE list.
Ex: countruns yields integer
encoderleflatdata
Returns encoding in RLE of the raw data passed in; used to generate RLE representation of a data.
Ex: encoderle yields list
getdecodedlengthrledata
Returns decompressed size RLE data; used to generate flat data from RLE encoding. Counterpart to #
Ex: getdecodedlength yields integer
decoderlerledata
Returns the decoded data set from RLE encoded data. This decompresses RLE data for use. Inverse of #
Ex: decoderle yields list
stringtodatadatastring
Translates a string in hexadecimal format into byte data can be raw or RLEInverse of #
Ex: stringtodata f yields list
torlestringrledata
Translates RLE data into a humanreadable representation. For each run, in order, it should display the run length in decimal digits; the run value in hexadecimal digit; and a delimiter, : between runs. See examples in standalone section.
Ex: torlestring yields string f:
stringtorlerlestring
Translates a string in humanreadable RLE format with delimiters into RLE byte data. Inverse of #
Ex: stringtorlef: yields list
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started