examines the bytes for validity (even parity), and also examines each line for validity (checksum).
Your program should write the decoded text of the input binary file to the screen, so that it may be
viewed, along with indicators of the corrupted data that was found. After all the data in the file has
been processed, your program should report how many corrupted characters and lines were found in
You are given a binary file on the BB that you may assume has already been transmitted to your
computer, and which was coded for error detection. It contains redundant information to be analyzed
to help find what data may have been corrupted on transmission. It has even parity for each byte and
also a 16 bit checksum value after each new line in the file. Read from "CodedText" as a binary file.
You must check the parity of each byte, and then extract the character of text from the byte. Whenever
a new line character is found, read in the next two bytes of data as an unsigned short int which contains
the recorded checksum value for that line. Also you will need to find the sum of the ASCII values of
all characters on that line (including the parity bits and the new line character). Thus you will have the
checksum_from_file and the checksum_as_calculated. These will need to be compared to see if you
have a corrupted line. You may assume that the new line characters have not been corrupted.
For each input line along with the checksum value there are 3 possible output cases that you must
handle: In all cases you will need to strip out the parity bits and the checksum value before you output
that line to the screen.
This question was asked on Apr 16, 2010.
Recently Asked Questions
- Please refer to the attachment to answer this question. This question was created from hhsadirec.
- At McCool’s bar there is a stock of 17 beer bottles in the cooler with label. The barkeep checked the bottles last week and noted most contained beer and
- Why is Presidential power "conditional" -- that is, why is it affected so substantially by circumstances, the nature of the issue, the make-up of Congress,