CodeDetection

CodeDetection - / u/* / Author: D. S. Malik / / Program:...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
u //************************************************************* // Author: D. S. Malik // // Program: Code Detection // This program checks whether the message received at the // destination is error-free. If there is an error in the // message, then the program outputs an error message and // asks for retransmission. //************************************************************** / import java.io.*; import java.util.*; i public class CodeDetection { static final int maxCodeSize = 250; s public static void main (String[] args) throws FileNotFoundException { int[] codeArray = new int[maxCodeSize]; //Step 1 int codeLength; //Step 1 c //Step 2 Scanner codeFile = new Scanner (new FileReader("SecretCode.txt")); PrintWriter outFile = new PrintWriter("SecretCodeOut.txt"); codeLength = codeFile.nextInt(); //Step 3 if (codeLength <= maxCodeSize) //Step 4 { readCode(codeFile, codeArray, codeLength); compareCode(codeFile, outFile, codeArray, codeLength); } else System.out.println("Length of the secret code "
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 06/17/2011 for the course COMP 2301 taught by Professor Staff during the Spring '10 term at Kennesaw.

Page1 / 2

CodeDetection - / u/* / Author: D. S. Malik / / Program:...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online