Computer Science Homework

profileJoshuaTT
asgn06_start.txt

final static int AlphabetSize = 26; final static Scanner cin = new Scanner(System.in); final static PrintStream cout = System.out; final static int MaxBarLength = 50; public static void main(String[] args) { String fileName; // sign-on cout.print("CPS 150 Assignment 6 by __your name here___\n\n"); // get the file name cout.print("Enter the file name: "); fileName = cin.nextLine(); // process the file try { processFile(fileName); } catch (IOException e) { e.printStackTrace(); } // end try // sign-off cout.print("\nAssignment 6 complete\n\n"); } // end main static void processFile(final String fileName) throws FileNotFoundException, IOException { FileInputStream inFile = new FileInputStream(fileName); int inputValue; // declare other variables you need // get the first character from file inputValue = inFile.read(); while (inputValue != -1) { char ch = (char) inputValue; // add code to process this character // read next input character inputValue = inFile.read(); } // end loop inFile.close(); // generate appropriate output } // end function static void display(final int [] counters) { // write code for this function } // end function // char2int is complete static int char2int(final char arg) { if (!Character.isLetter(arg)) return -1; else return (int) Character.toUpperCase(arg) - (int) 'A'; } // end function // function printChars writes n copies of the character c to the // standard output device static void printChars (final int n, final char c) { // write the code } // end printChars // this function returns the largest value stored in the array static int maxCount(final int [] arr) { // write the code } // end function