Join Carlos Rivas for an in-depth discussion in this video Perform calculations, part of Code Clinic: Java.
- [Instructor] After we have finished loading…all the data from our input files…and place it in our in-memory data store,…we can finally proceed to operate on it,…in order to generate our desired outcome.…This is where our due calculation method comes in.…Let's take a look.…Let's do our slope calculation in this process.…But before we do that, we need to be sure…that the from and to dates, provided as input,…are formatted properly.…
We do this by attempting to convert those date/time strings…into Java objects.…If this isn't possible, an exception will be thrown,…with an error message displayed on screen.…To further validate that this…string-to-date conversion was successful,…the values are included in the results string…that would be returned by this method.…You can see the date-to-time conversion…taking place on line 43, declaring the date formatter…and lines 47 and 48, doing the actual conversion.…
Next, we look to our array…until we find our start and ending time.…You can see this starting on line 60.…The values in the array stay in the order…
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
1. Problem 1: Pond Oreille
2. Problem 2: Where Am I?
3. Problem 3: Eight Queens
4. Problem 4: Accessing Peripherals
5. Problem 5: Facial Recognition
6. Problem 6: Real-Time Information Dashboard
- 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.