Write a multithreaded program to estimate the PI value using the Leibniz Series shown below. (1)...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a multithreaded program to estimate the PI value using the Leibniz Series shown below. (1) (2) 74 [[म = 1 || 8WI 1 3 + 1 (-1)* 2k + 1 - 1 1 + 7 9 ≈ 0-78539 81633 9744... You are asked to compute the first 500,000,000 terms of the series using the Fork-Join Framework. Each subtask should compute no more than 10,000 terms. Name your main class Leibniz PiEstimator and declare it in the package s2223.test2.student. Your program should measure the running time and the absolute difference between Math.PI and the approximated Pl value. You should print out the result as shown below. Output - Exam (run) run: This multithreaded program approximates PI using Leibniz series. Computed PI = 3.141592651589786, Difference = 2.0000072709080996E-9 Running Time (ms): 5749 BUILD SUCCESSFUL (total time: 5 seconds) A video content provider logs the clients' streaming requests daily. The streaming requests are stored in a file (video_data.txt) with one client request per line. Each line contains the following three fields separated by commas: • timestamp • video ID client's IP address Write a Java program to find the top 5 most active clients in the log file, i.e., the five IP addresses with the highest view count. A program template of the main class (LogAnalyzer) is provided to you. You need to implement the methods readDataFile() and findTop5Clients () in the main class. The specification of the methods is written and explained in the comment section. The expected program output is as follows: Output - Exam (run) % run: Top 5 active clients (client IP, view count): (207.146.146.159, 17) (206.141.157.150, 13) (201.162.145.140, 8) DD IDD (204.143.182.132, 7) (209.165.156.160, 2) BUILD SUCCESSFUL (total time: 0 seconds) Write a multithreaded program to estimate the PI value using the Leibniz Series shown below. (1) (2) 74 [[म = 1 || 8WI 1 3 + 1 (-1)* 2k + 1 - 1 1 + 7 9 ≈ 0-78539 81633 9744... You are asked to compute the first 500,000,000 terms of the series using the Fork-Join Framework. Each subtask should compute no more than 10,000 terms. Name your main class Leibniz PiEstimator and declare it in the package s2223.test2.student. Your program should measure the running time and the absolute difference between Math.PI and the approximated Pl value. You should print out the result as shown below. Output - Exam (run) run: This multithreaded program approximates PI using Leibniz series. Computed PI = 3.141592651589786, Difference = 2.0000072709080996E-9 Running Time (ms): 5749 BUILD SUCCESSFUL (total time: 5 seconds) A video content provider logs the clients' streaming requests daily. The streaming requests are stored in a file (video_data.txt) with one client request per line. Each line contains the following three fields separated by commas: • timestamp • video ID client's IP address Write a Java program to find the top 5 most active clients in the log file, i.e., the five IP addresses with the highest view count. A program template of the main class (LogAnalyzer) is provided to you. You need to implement the methods readDataFile() and findTop5Clients () in the main class. The specification of the methods is written and explained in the comment section. The expected program output is as follows: Output - Exam (run) % run: Top 5 active clients (client IP, view count): (207.146.146.159, 17) (206.141.157.150, 13) (201.162.145.140, 8) DD IDD (204.143.182.132, 7) (209.165.156.160, 2) BUILD SUCCESSFUL (total time: 0 seconds)
Expert Answer:
Answer rating: 100% (QA)
Here is a multithreaded program in Java using the ForkJoin Framework to estimate the PI value usin... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
A linear elastic spring can be compressed 10.0 cm by an applied force of 5.0 N. A 4.5 kg crate of apples, moving at 2.0 m/s, collides with this spring, as shown. What will be the maximum compression...
-
you are required to perform database table normalisation and present your solutions in a PowerPoint presentation. In doing so, you are required to demonstrate your work and solution through a series...
-
What am I required to do in this assignment? Shared Power is an information system to help tradesmen share expensive and specialist tools rather than buying them themselves. Registered owners add...
-
Our model of pollution in this chapter assumed that emissions are a pure private bad, and that people have no ability to protect themselves from the adverse consequences of exposure. In reality,...
-
The following data represent the total compensation for 12 randomly selected chief executive officers (CEO) and the company's stock performance in 2013. (a) One would think that a higher stock return...
-
In a recent ranking of top graduate business schools in the United States published by U.S. News & World Report (March 10, 1997), data were provided on a number of attributes of 25 recognized...
-
Prepare a sales ledger control account from the following information for July 19X9, carrying down the balance at 31 July: 19X9 July 1 July 31 Sales ledger balances Sales journal 9,700 99,280 Bad...
-
The Garrett Company has the following transactions during the months of April and May: The cost of the inventory on April 1 is $5, $4, and $2 per unit, respectively, under the FIFO, average, and LIFO...
-
Can you please help me with this question: E4.10 (LO3) (Earnings per Share) The equity section of Sosa SA appears below as of December 31, 2019. Share capital??preference (6% preference shares, R$...
-
A Queue Abstract Data type (ADT) has these associated operations: Create queue Add item to queue Remove item from queue The queue ADT is to be implemented as a linked list of nodes. Each node...
-
Address following queries V Explain using an example why a histogram cannot be taken as a global feature of image. What limitation of a single perceptron was highlighted by the Minskey? Ve Explain...
-
Your sponsor wants you to create a new delivery system. After you ask why the new system is needed and determine what is wrong with the current system, you are then able to create which key document?...
-
1. Has the writer followed the assignment instructions for the research report assignment and provided all sections of the report, completed correctly. as requested by the instructions? If not, what...
-
In the video clip you watched called "Substitute Teacher" from the movie "Catch Me If You Can," Leonardo DiCaprio's character posed as a substitute teacher. This example was used to illustrate which...
-
3. Representing constraints (40 points) Constraints represent restrictions, which can be modeled mathematically as boundaries. One of the simplest and yet powerful ways to represent constraints is...
-
True or False? The financial statements that a company files with the Securities and Exchange Commission (SEC) are among the main sources of information that investors use to research that company
-
2. The value of a share today is N$10. It is thought that in two week's time the share will be worth either N$12 or N$9. An option will pay off N$0.5 if the share has value N$12 and N$0.05 if the...
-
1. Using the information from Problem 16-4B, prepare a statement of cash flows for Lim Garden Supplies Inc. using the direct method of presenting cash flows from operating activities. 2. How does Lim...
-
Mike purchases a heavy-duty truck (5-year class recovery property) for his delivery service on April 30, 2012. The truck is not considered a passenger automobile for purposes of the listed property...
-
Mark owns his home and has a $250,000 mortgage related to his purchase of the residence. When his daughter went to college in the fall of 2012, he borrowed $20,000 through a home equity loan on his...
-
Deborah purchases a new $30,000 car in 2012 to use exclusively in her business. If Deborah does not elect to expense or take bonus depreciation in 2012 and holds the car until it is fully...
-
What would not be an abusive earnings management scheme according to the SEC? a. A big bath b. Channel stuffing c. Postponing repairs and maintenance expenses d. Cookie-jar accounting e. a. and c....
-
Which statement is false with respect to the PCAOB? a. PCAOB issues standards describing auditor's attestation requirements. b. D.W. Squires was a former chief auditor of PCAOB. c. PCAOB is a...
-
Select five of these alleged fraudsters and prepare a two-paragraph discussion of them. Outline their modus operandi. 1. Frank Abagnale 2. Jack Abramoff 3. Kobi Alexander 4. Eddie Antar 5. Jim Bakker...
Study smarter with the SolutionInn App