Title Swap adjacent characters in a RandomAccessFile
Catalog Type SLCItem
Persistent ID https://codecheck.io/files/horstmann/codecheck-bj-4-io2-104
Platform Name CodeCheck
Features Code Completion
Description Your task is to swap adjacent letters in a RandomAccessFile. Simply read two bytes, back up by two bytes, and write the values out. If the file has an odd number of bytes, don't swap the last one. Also, don't swap byte pairs that contain the newline or return characters ('\n' or '\r'). If either byte of a pair equals one of these characters, skip the pair and move on to the next pair.
Keywords Advanced Input and Output
Author Cay Horstmann
Institution San José State University
Iframe URL https://codecheck.io/files/horstmann/codecheck-bj-4-io2-104
Protocol SPLICE, LTI 1.1
Protocol URL
License https://creativecommons.org/licenses/by-nc-nd/4.0/
Programming Language Java
Natural Language en

Preview

SPLICE Output