Learn to code in Java and improve your programming and problem-solving skills. You will learn to design algorithms as well as develop and debug programs. Using custom open-source classes, you will write programs that access and transform images, websites, and other types of data. At the end of the course you will build a program that determines the popularity of different baby names in the US over time by analyzing comma separated value (CSV) files.
After completing this course you will be able to:
1. Edit, compile, and run a Java program;
2. Use conditionals and loops in a Java program;
3. Use Java API documentation in writing programs.
4. Debug a Java program using the scientific method;
5. Write a Java method to solve a specific problem;
6. Develop a set of test cases as part of developing a program;
7. Create a class with multiple methods that work together to solve a problem; and
8. Use divide-and-conquer design techniques for a program that uses multiple methods.

Avaliações

CC

Great course, it does help to have some background knowledge in another language but it is doable without any. goes through some fun projects but also some work usable items such as CSV parsing.

DN

Aug 08, 2016

Filled StarFilled StarFilled StarFilled StarFilled Star

You need a little more experience in coding that just the first course, or try not to leave everything by the end of the week(as I did) to find what you need for the assignments. Great course !

Na lição

CSV Files and Basic Statistics in Java

A common format for storing tabular data (any data organized into columns and rows) is in comma separated values (CSV) files. In this module, you will learn how to analyze and manipulate data from multiple CSV data files using a powerful open-source software package: Apache Commons CSV. Using this library will empower you to solve problems that could prove too complex to solve with a spreadsheet. By the end of this module, you will be able to: (1) Use the open-source Apache Commons CSV package in your own Java programs; (2) Access data from one or many CSV files using Java; (3) Convert strings into numbers; (4) Understand how to use “null” in Java programs (when you want to represent “nothing”); (5) Devise an algorithm (and implement in Java) to answer questions about CSV data; and (6) Analyze CSV data across multiple CSV files (for example, find maximums, minimums, averages, and other simple statistical results).

Ministrado por

Owen Astrachan

Robert Duvall

Andrew D. Hilton

Susan H. Rodger

Transcrição

Welcome back. The first piece of solving the problem of finding the highest temperature in a year, which has its data spread across hundreds of files, is to find the maximum temperature in one day, which always has one file. As always, we're going to start by working a small example by hand in a step by step fashion. Here we have six rows of data to work with. The first thing you might do is look at the first row, and in particular at its temperature, which is 30 degrees Fahrenheit. That is the maximum we have seen so far, which you will wanna keep track of. If you were just working this out with a small data set, you might just remember it in your head. But we will draw a red box around it to be explicit. You might then go through the rest of the data in a similar fashion, looking at each row and deciding whether it is the largest you have seen so far or not. After you looked through all the rows, you have found your answer. Which in this data file, is the last row. Okay. Now that we have worked an instance of the problem by hand, it is time to write down exactly what we did in a step by step fashion. The first thing we did was look at the first row. In particular, its TemperatureF column. Next, we noted that it has the largest temperature so far. The next step was to look at the second row. Its temperature is not greater than the largest temperature we have noted so far. Then we looked at the third row. Its temperature is 30.9, which is larger than the largest we have seen so far. So we updated our largest so far to be the third row. For the fourth row, we did very similar steps. Saw that 32 was larger than the largest so far. And updated our largest so far. The fifth row was not larger than the largest so far. And the sixth row was larger than the largest so far. So we updated our note of what was the largest. That was the last row. So we are ready to give the answer. In this case the sixth row was our answer. Now that we have all of those steps written down for this particular instance of the problem we are ready to find patterns and generalize. The first thing you might notice, is that you are doing similar, but not quite the same things, for each row of the CSV file. As you can probably guess by now, you will eventually write code, which loops over the rows to solve this problem. However, before you can do that you need to think about the differences, and find ways to make them the same. The first difference you might notice is that for the first row, we just noted that it was the largest so far. But, for later rows, we compared the row to what we had previously noted down as our largest so far. The first row is a bit unusual here because we have nothing else to compare it to. We did something implicit that we did not write down. We check if our largest so far was nothing, or something first. We'll need to incorporate that into our generalized steps. The other difference you might notice is that sometimes we updated what we recorded as the largest so far, while other times we did not. We marked the first rows update in purple as we just discussed how it is different from the others. And mark the steps in red where we did not update the largest so far, and in green where we did. What is the pattern? It is when the current rows temperature is higher than the largest so far's temperature. Thinking through these patterns leads us to the following thoughts on how to decide when to update the largest so far. If the largest so far is nothing, meaning we don't have one yet, then the current row is the largest so far. Otherwise, if the row's temperature is greater than the largest so far's temperature, then the current row is the largest so far. After thinking through that, we can express our algorithms in terms of, for each row in the CSV file. For each row, which we will call currentRow, you will want to decide how to update the largestSoFar variable, as we have just discussed. We have not said anything about what largestSoFar starts as, so we should be sure to put that in here. We mentally glossed over this while we were writing down our steps, but we implicitly started with it as nothing before we began looking at each row. We should write that down in our algorithm here. The last step, which we did write down, was to give our 6th row as our answer after we finished looking at each row. Is the answer always gonna be the 6th row? No. It is always going to be the largestSoFar, the row that we have been keeping track of as we worked through the data. We should test this out before we try to write our code. Try it out on these four rows of data. Does the algorithm give the right answer? Yes it does. We are now more confident that we wrote our algorithm correctly so we are ready to turn it into code.