The assignment is about using multithreading for parallel programming.?In the assignment folder you will find: zip file for examples of using Java Multithreading main functions. the pdf v

Parallel Computing and Distributed Systems

Assignment 1 (10 points)

Question1 (parallel vs. sequential):

In this question, we need to measure the time difference between performing certain tasks sequentially and dividing and then performing the same task in parallel. Create a class named STUDENT, that holds the student’s GPA (float value between 2.0 to 4.0), AGE (integer value between 18 to 30), and ID (unique integer value per student). For each of the following versions, calculate (using Java.Time or the Java API you find appropriate) how long each version takes in seconds.

• Sequential version (Name this file as Q1_SeqV.java): o Create a list of 50,000 students with randomly generated GPAs, randomly generated Ages, and sequential IDs. o After creating the list, your program calculates and prints the average GPA and average AGE.

• Parallel version 1 (Name this file as Q1_PLV1.java): o Repeat the sequential version using two threads along with the main thread. o Each thread creates a list of 25,000 students with randomly generated GPAs, randomly generated Ages, and sequential IDs. o Each of the two threads then calculates the average GPA and AGE (after creating the lists). o The two threads work in parallel. o The main thread waits for the two threads to finish and then calculates and prints the final average GPA and AGE from what

is reported by the individual threads.

• Parallel version 2 (Name this file as Q1_PLV2.java): o Repeat the Parallel version1 task using five threads (each is working on 10000 students) along with the main thread.

To measure the time your computer takes to complete a certain task:

• Read and store the current time (t1) before you start the task (e.g., before creating the lists), • After the task (e.g., after calculating the average), read and store the current time (t2). • The time it takes your computer to complete the task is then: t2 – t1.

Question2 (Sorting):

In this question, we need to divide, sort, and merge a list of Employees using the multithreading framework. Create a class named EMPLOYEE that holds the employee’s ID (integer value of unique value) and salary (integer value).

Step1: The main thread creates a list of 10,000 Employees with sequential IDs (1 to 10,000 to keep them unique) and randomly generated salaries (between 1500 to 4000); name this list EmpList.

Step2: Split the generated list EmpList into two lists of equal length: List1, and List2.

Step3: Create two threads; each thread should sort the corresponding list (thread1 sorts List1, and thread2 sorts List2) ascendingly with respect to the salary.

Step4: The main thread then waits for the two threads, then merge the two sorted sublists (List1 and List2) into the main list (EmpList) ascendingly with respect to the salary.

Submission: 1. Use the IDE you find appropriate to develop your Java programs, and then create one PDF file where you list/copy the code

you developed for each question along with a screenshot for the outputs (of question 1 only).

2. Submit ONE ZIP/RAR file for the developed Java files and the PDF, named lastname_firstname.zip, directly to the folder titled Assignment 1 under the D2L Assignments tab (other formats will not be accepted).

3. Check the due date on D2L. You can submit your assignment within 24 hours after this due date to be graded out of 50% of the assignment’s grade. After this grace period, your late submission will not be accepted.

Place your order
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more