computer since java asgn
A6D2.txt
A quick brown fox jumps over the lazy dog.
A6D3.txt
CPS 151/Fall 2011 Assignment 01 (Vectors of structs/Sorting/Graphic output) Assigned: August 29, 2011 Due: September 8, 2011 Do you know which letter is most frequent in typical English text? Which is the least frequent? In this assignment you will read some text from a file and count the number (the frequency) of each letter. The frequencies will be stored in a vector (of a structure). But to understand the basic ideas let us use an array of integers (size 26) first. Upper case and lower case letters will not be distinguished. Characters other than letters (such as digits, punctuations, other symbols) may be present. Those non-alphabetic characters will not be counted. Suppose we declare: int counters[26] = {0}; // initialize all counters to zeros What will be the contents of the array counters after the following text is processed? A quick brown fox jumped over the lazy dog. 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
A6D4.txt
23658134-01284830903=-1298230 47523758347048329412948412834=2 13827 9840298430812836848444680 #$^*&()(^$^%)*))_((_(_(_ %*&*))(_(_(9=-90=098488308504+88+8-8+5+86 7357934640964=-0634-534
Asgn6 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
A6D1.txt
This assignment is the beginning of a grading program, which we will continue to develop over some of the following assignments. The objective of the program is to input 3 test scores (in the range 0-100), calculate the average score, then determine the appropriate letter grade using the standard scale, A - 90% or above, ... F - below 60%. Input to the program: a) student's first name and last name (use C++ string class) b) 3 test scores (all int) Output from the program (all on one line, table format) a) student's name in (last, first) format (Calculated, not just displayed) b) 3 test scores (int) c) average (double) Show only 2 digits after decimal point d) letter grade (char)