Join Patrick Royal for an in-depth discussion in this video My solution: Operating on data, part of Code Clinic: Java.
…Although the most important function of this code for the end user is that it…calculates the mean and median, the actual data…analysis is the easiest part of this challenge.…Once the data has been downloaded in a useful format, it's really just…a matter of recalling grade school arithmetic…and then translating that into Java code.…Let's start by looking at the mean method.…The mean method should take in an array list of doubles and return a double.…So the syntax for its declaration is just public…static double mean, and then array list of doubles.…
The static modifier is required here because everything…will be called by the static mean method.…A mean or average is defined as the sum of all the…values in a set divided by the number of values in that set.…To take the sum, we define a simple loop as follows.…First, we set the sum to 0, then we define the loop, for double i in…array list, which means that the loop will…operate for each double in the array list a.…And then on each iteration of the loop, we add that…
Patrick introduces challenges and provide an overview of his solutions in Java. Challenges include topics such as statistical analysis, searching directories for images, and accessing peripheral devices.
Visit other courses in the series to see how to solve the exact same challenges in languages like C#, C++, PHP, Python, and Ruby.
Skill Level Intermediate
Q: I am unable to access the Lake Pend Oreille data from outside the U.S.
A: A static copy of this data is provided here for lynda.com members outside of the U.S
Problem One: Exploring Lake Pend Oreille
Problem Two: Image Analysis
Problem Three: Eight Queens
Problem Four: Accessing Peripherals
Problem Five: Recursion and Directories
Problem Six: Building the Web
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.