Find Us On: Facebook Twitter Rss Feed Blog
Need To Register? Sign Up Login

CS520 HW6

Darryl
Darryl 


I need a program written based on the attached instructions. Attachments Tags
Clarifications

Answers

CS520 HW6 Part1&2

mariobeka
mariobeka 



In the zip file you find the implementation of part 1 and 2 of your assignment. Attachments
HW6.zip (4 K) Download
Preview
target; } @Override public void run() { System.out.println(this.getName()+" is running"); int occurrences = 0; // Check for occurrences in the input data for (int i = 0; i <

Preview
public char getTarget() { return target; } @Override public String toString() { return "<" + target

Preview
SharedResults() { results = new ArrayList<>(); } public synchronized void addToResults(ResultsEntry entry) { results.add(entry); System.out.println( Thread.currentThread().getName() + " is adding "

Preview
class Test { private final static char[] ALPHABET = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' }; private final static String PAGE = "http://norvig.com/big.txt"; public static void main(String[] args) {

Preview
0; // Check for occurrences in the input data for (int i = 0; i < inputData.length(); i++) { if (inputData.charAt(i) == target) { occurrences++; } } // Create an entry with the result of

Preview
} catch (InterruptedException e) { e.printStackTrace(); } } results.add(entry); System.out.println("Calling Thread's Turn " + turn + " Thread, " + Thread.currentThread().getName() + " is adding " + entry + ",\n Cumulative Result is " +

Preview
Create a SharedResult object SharedResults sharedResults = new SharedResults(); // Create an array of 26 LongTasks LongTask[] longTasks = new LongTask[ALPHABET.length]; // Initialize and start each long task for (int i = 0; i < longTasks.length; i++) { longTasks[i] = new LongTask(sharedResults, buffer, ALPHABET[i], i); longTasks[i].start(); } // Join each

Screen Shot 2017-04-26 at 01.55.15.png (143 K) Download Preview

Screen Shot 2017-04-26 at 01.55.26.png (227 K) Download Preview

Screen Shot 2017-04-26 at 01.56.04.png (88 K) Download Preview

Screen Shot 2017-04-26 at 01.56.53.png (239 K) Download Preview

Screenshots
Screenshot
Screenshot
Screenshot
Screenshot
Purchase Answer