Your Perfect Assignment is Just a Click Away

We Write Custom Academic Papers

100% Original, Plagiarism Free, Customized to your instructions!

glass
pen
clip
papers
heaphones

COSC AB-JAVA2-Assignment 2A

COSC AB-JAVA2-Assignment 2A

ASSIGNMENT 2A

Design a program/project/driver class (the program/project/driver class file should be called YourNameAssignment2A; replace YourName with your actual name), that is going to show your understanding of program complexity on different solutions to the same problem.

Part 1. Add to your YourNameAssignment2A driver class the following 3 methods (use the exact/precise names) to compute Nth element of the following series (representing the sum of the squares of the first N positive integers): 1+22+32+…N2

Method Description

Method1 A recursive method with parameter N that used recursion to compute the Nth element in the series.

Method2 A brute method with parameter N that uses a loop to compute the Nth element in the series.

Method3 A mathematical method with parameter N that uses mathematic summation formula1 to compute the Nth element in the series.

In your main method, call all the 3 methods Method1, Method2, and Method3 to determine which of the 3 methods is faster by computing the run time 2 needed for the following 5 values for N : 100000 (a hundred thousand), 1000 (1

thousand), 10 (ten), -1000 (negative one thousand), and -1000000 (negative one hundred thousand) and output the values or ERROR3 (if you run into a memory Overflow or Out of Memory issue even after using the largest integral type) in a table format below (no lines needed) in which each cell has the run time for that method for that value for N.

NMethod Method1 Method2 Method3

100000

1000

10

-1000

-100000

Part 2. Compute the complexity of each of the 3 methods/algorithm using the Big O notation and add the calculations for each of the 3 methods into a Microsoft Word document called YourNameAssignment2A-Complexity.docx (replace YourName with your actual name). You should show the Big O notation calculation for the method complexity for each one of the 3 methods. Which of the 3 methods is the best one? Add your answers to the document in the table bellow: in column to the complexity of that method in Big-O notation and on the third column the Big O notation calculation for the method complexity with explanations. For the Best Method, explain why the listed method is the best.

Method Complexity in Big O notation Calculation/Explanation

Method1

Method2

Method3

Best Method

Part 3: Create a document Create a Microsoft Word document called YourNameAssignment2A-Screeshots.docx (replace YourName with your actual name) that contains screenshots of the complete JAVA source code in the IDE and the complete program output. If the entire class JAVA source code or the output does not fit in one screenshot or the screenshots cannot be easily read, create multiple screenshots and add them to the same document.

Submit YourNameAssignment2A.java JAVA source code file, YourNameAssignment2A-Complexity.docx complexity analysis document, and YourName-Assignment2A-Screenshots Microsoft Word screenshots document on eCampus under the Assignment2A. Do not archive the files (no ZIP, no RAR, etc) or submit other file formats. Review the files in your eCampus submission confirmation window.

1 Look at this website to find the formula and, if interested, to see how it is computed https://brilliant.org/wiki/sum-of-n-n2-or-n3/ 2 You can compute the run time using the System.nanoTime() method 3 Output “ERROR” if you run into a memory Overflow or Out of Memory issue even after using the largest integral type

Order Solution Now

Our Service Charter

1. Professional & Expert Writers: Blackboard Experts only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed of papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by Blackboard Experts are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. Blackboard Experts is known for timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit in all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At Blackboard Experts, we have put in place a team of experts who answer to all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.