Computer Science AP Java Video Course

atomictoddler.com -   [index]     [Page 2]     [Page 3]     [Page 4]     [Page 5]  

***UPDATE - I had to move the videos for this course to a new YouTube channel.
***Please access the videos from this new channel from now on
***and share, subscribe, and watch as much as you can with others!
***I will be deleting the old channel very shortly!
*** https://www.youtube.com/channel/UCw2zv1zmT5ak5olBgB7IqmA


ABOUT THE COURSE

Introduction
So you want to learn to learn how to program? Perfect! The AP Computer Science Java course is a great introduction to programming that will walk you through standard topics that university/college students learn in their first few months of programming. Just follow the material below in order and try to complete all the practice assignments along the way to gain the coding skills that are presented in the videos. Solutions provided.

Videos for the course
This course uses a lot of videos to present and talk about programming concepts. The videos can all be found on the YouTube channel called "Computer Science AP Java" which you can link to from this link: Course Videos Channel . Once you're in this channel, just find the video your looking for by going into the AP Computer Science Playlist and finding the title of the video. Remember you can search by title too - videos from the same topic always start with similar word/s.

Should I do everything shown in the videos?
It's up to you. Usually after watching a video or two or three there will be some practice programs to code that will get you to use the concepts just presented. If you need to test stuff out right away, then by all means follow along and code a bit while watching the videos.

Downloading the projects shown in the videos
All the projects that are shown in the videos are available from this link: Java Lesson Projects .
This can be really useful for looking at the completed code. Read it and learn from it.

Folders/links you will have to use
Sometimes you will be asked to grab files and worksheets and answer keys from these folders:

The resources folder: Resources folder
The documents folder: Documents folder
The projects folder: Java Lesson Projects

Ready? Now lets get started!


01 GETTING STARTED

Watch "InstallingSoftware"
This course requires that you install Java, the Java Development Kit (JDK), and Netbeans IDE (Integrated Development Environment) on your computer. Everything is free and it is a very easy install. Watch the video to help you along. The website shown in the video that we download the software from is part of Oracles website, the link is here: Oracle's Netbeans JDK Bundle Download Page . Once the software is installed you should just be able to start running Netbeans with no problems. If you do have problems, check out Google and search for the error that you are receiving - there are many pages and posts about common installation problems.

Watch "FirstProject_HelloWorld"
This first video walks you through using Netbeans to create your first Java program. It's a standard program that many programmers remember doing when they started out.

Watch "CompilingCode"
This video give a quick discussion about what takes place after you type in some Java code and hit 'Run' in Netbeans.

Watch "VariableIntroduction"
Most programs need to remember things like numbers and text. This video will give a quick introduction to how you can store numbers (specifically integers) in your programs.

Watch "NamingVariables"
Your programs will probably use many variables, so lets learn some basic rules for naming them so that other programmers won't think that you are a noob.

Watch "VariablesIntsDoublesAndCasting"
We took a quick look at integers before. Lets take a more detailed look at how integers and integer math works in Java. We'll also look at storing decimals numbers as doubles and something called casting that allows you to control how integer and decimal math takes place in your simple lines of math.

Watch "ModulusOperator"
You know how to +, -, *, and / but do you what % does? This is the modulus operator. It can give you the remainder of the division between an integer and another integer.

Download the UserInput.java file before continuing!
This file contains a java class that has already been coded for you. It will allow a simple and clean way to let the user enter numbers and text in your programs while learning the basics. Download UserInput.java from the resources folder: resources folder .

Watch "UserInput"
Setting up your program to accept user input allows you to do much more with your programs. For the first few lessons we will use a class called UserInput to allow the user to enter numbers and words as our program runs. This video will walk you through setting up your project to use the UserInput class that you just downloaded.

Watch "SettingUpPracticeProject"
You're about to be given a set of short programs to code into the computer. This video will walk you through how to set up a project of your own that you can use to code and test these programs.

Complete Skill Mill One Practice
Set up a practice project like the previous video explained.
Locate and download the Skill Mill One Practice problems from the documents folder: documents folder .
Code in the short programs described.

Solutions to Skill Mill One
Did you try your best and still couldn't get a solution to work?
There's a solution project called SkillMillOneSolutions in the Java Lesson Projects folder.


02 CONDITIONS

Watch "StringsIntroduction"
We have learned how to store integers and decimal numbers in memory. What about text, letters, and symbols? This short video will introduce you to the variable type String which does just that.

Watch "DebuggerBasics"
Any good IDE (Netbeans) has a debugger system that will allow you to follow your program's execution along line by line and examine the value of variables as they change in your program. This video will show you the most basic way to use the debugger built into NetBeans.

Watch "Conditions 01"
So far your programs are executing every single line of code that you type. But most programs need to make decisions as to which lines of code should be executed under different conditions. This video will introduce you to simple conditional statements using the "if" and "else" statements.

Watch "Conditions 02"
There's even more you can do with conditions. This video will take a look at if / else if / else chains that will give you a few more options when deciding which blocks of code to execute in your program.

Run Conditions 02 With Debugger
Download the project Conditions02 from: the Java Lesson Projects folder.
Run the program/s with the debugger. Place a break point near the start of the program and step over each line watching where the program 'goes' as it executes. *Watch out, out some computers open the input box behind the Netbeans window when debugging (in case you can't find it!).

Watch "Conditions 03"
What if you want to check several conditions in the same line? Watch this video and find out how to use && (AND) and || (OR) and 'nested' if statements in your code.

Read Conditions Reference Sheet
This sheet is in the documents folder. It contains a page or two of sample conditional statements. You can read through to make sure that they all make sense. Use this as a reference when practicing.

Complete Skill Mill Two Practice
Locate and download the Skill Mill Two Practice problems from the documents folder: documents folder .
Add your coded solutions to these short programs to the practice project that you used for the SkillMill One problems.

Solutions to Skill Mill Two
Did you try your best and still couldn't get a solution to work?
There's a solution project called SkillMillTwoSolutions in the Java Lesson Projects folder.


03 ITERATION AND LOOPS

NO MORE GIVING YOU LINKS TO THE FOLDERS. YOU SHOULD NOW KNOW HOW TO GRAB DOCUMENTS, PROJECTS, and RESOURCES.

Watch "Do While For Loops 01"
In this video we are going to learn to harness the power of iteration! Another word for iteration is 'repeating' or 'looping'. So lets learn how to make your code 'loop'. This is a very important and powerful feature of any programming language!

Read Loops Reference Sheet
This sheet is in the documents folder. It contains a page or two of short, sample loop code. You can read through to make sure that they all make sense. Use this as a reference when practicing.

Complete Skill Mill Three Part 1, 2, and 3
Exactly what the title says! Locate in the documents folder. Don't do the entire worksheet - just part 1, 2, and 3.
There is a solution file that can be found in the documents folder.

Code Reading Practice (Eight Example Code)
Lets see if you can learn a little more about loops by reading some useful loop code examples.
Grab the Loop Examples Code Sheet from the document folder - it contains eight sample programs.
Read each program and try to describe what it is doing. Don't give up either, give a good effort at learning from reading other people's code!

The programs are all coded into a project called LoopExamples in the project folder:
Positive Number, Password, Sum Series, Factorial, Bank Interest, Top Grade, Is Prime, and Name and Password.

Watch "LoopExample???" Videos
There is a video for each LoopExample program listed above. It shows me coding and explaining each program. If you found the example code easy, don't worry about watching all the videos.

Watch "LoopExamples IsPrime"
Even if you understood the eight code segments, watch the IsPrime video since it talks about three new concepts: boolean variables, using a flag variable, and the 'break' command.

Complete Skill Mill Three Part 4
Exactly what the title says! Locate in the documents folder. Use the eight loop examples code as a reference sheet to help you code the problems in part four of this practice sheet. The answer key is in the documents folder and the projects folder but don't use it unless you have given 110% on figuring the stuff out yourself.


04 SHORT GAME AND RANDOM NUMBERS

Watch "Random Numbers"
Sometimes you need your program to pick a random value or two. The Math class and the Random class can both be used to generate random numbers in your programs. The code shown in the video is in the projects folder.

Watch "Planning Dice Game"
Larger programs require some planning before you start coding. This short video will give you an idea of how you can do a simple plan of attack on your programs as they start to get a little larger and more complicated.
The document DiceGame_Planning.pdf can be found in the documents folder.
The completed project DiceGame can be found in the projects folder.
If you think you can code this game with no help, go for it now before watching the next videos!

Watch "Coding Dice Game 01" and "Coding Dice Game 02"
The first video will walk you through coding the dice game without using any loops.
The second video will walk you through adding the do and while loops in at the appropriate locations so that the game matches what was shown on the Planning the Dice Game document.
The completed project is in the projects folder.

Plan And Code A Game
Time for you to combine your variables, random numbers, conditions, and loops to create a game or two. Go to the documents folder and open up Code A Game and pick one of the games listed. After reading the game description you should

1) Plan the game out on paper and show it to your teacher to have it approved.
2) Start a new project and code the game until it works as intended.

The games listed include The Guessing Game, Rock Paper Scissors, and Mega Slots.


05 NETBEANS GUI (Graphical User Interface)

Watch "NetbeansGUI_Part1"
How to set up a project that uses a JFrame as your main class. Includes how to drag and drop components like buttons and text boxes onto your frame. No coding of the components in this video!

Watch "NetbeansGUI_Part2"
What are events and how do you add code when an event takes place? We'll code the action performed event of some buttons and see how to use the text boxes to display text and numbers. We'll also learn how to read text and numbers from text boxes.
Converting numbers to Strings and Strings to numbers is a big focus in this video and necessary when working with many Java components.

Watch "NetbeansGUI_Part3"
Not all variables are created equal. WHERE you create a variable decides it's scope in the program. Scope includes where the variable exists and where it is accessible. This short video will introduce you to giving variable a larger scope (your entire frame class).

Watch "NetbeansGUI_UsingRandom"
In a previous video you saw how to include random number generation in your programs. If you are a little confused how to include random numbers when working with a Frame then watch this video. We'll import the random class, create an instance of the Random class, and then generate a random number through a button click event.

Watch "GUI Game Example 01 and 01b"
In these two videos I demonstrate making a simple game from scratch using the Netbeans GUI. New content like enabling and disabling buttons is demonstrated. Generating random numbers. Using buttons and textboxes. Conversion of numbers to strings to place in textboxes.
The project made is called 'GuessTheRoll' and is in the projects folder if you want to examine it.

Design and Develop - Random Number Frame Game
You previously coded a short random number game. Now take what you have learned from the GUI tutorials and turn your game into a framed game.
Start with an empty project and add a JFrame. Design a user interface with buttons and text boxes that will let you re-code your game using a frame. Remember that some of your variables might need the scope of the entire frame. Remember to convert numbers and strings when required. Have fun making an actual windows program! If you are having trouble with this task, check out the optional videos just above in which I video the entire process of a simple game.

Watch "Building Executable File"
Once you have a JFrame project working perfectly you probably want to be able to run it on the computer without having to open up Netbeans (only nerds do that). So, watch this short video and find out how to 'build' your project into an executable file that you can give to your friends that have the Java Virtual Machine installed on their computer (that's most people).

06 ARRAYS INTRODUCTION

Watch "Arrays Introduction"
Arrays are an object that allow you to store many values inside of them - sort of like a list. This video will introduce you to the very basics of creating and using an array.

Complete Worksheet "Array Basics 01"
A couple of quick problems to see how much you learned from the previous video. In the documents folder.

Watch "Arrays With Loops"
Using loops with arrays can allow a programmer to accomplish tasks that just weren't possible before. Check out how arrays will allow you to code routines that require only a few lines of code and operate over huge amounts of data.

Code This "Array Coding 01"
A few short routines to code in that use loops and arrays. In the documents folder.

Watch "Arrays Length"
You don't always know the length of an array (you'll understanding why later in the course). There is way to find out the length of any array and it's easy, just watch this video. Using the length variable also makes your code re-useable with arrays of various lengths.

Code This "Array Coding 02"
A few short routines that involve arrays, swapping, and loops.

Watch "Arrays Swap Shuffle" (Solutions to the Array Coding 02 problems above)
This video covers the solution to the 3 Swap Array Problems. If you solved the problems on your own, you probably don't need to watch this. The solutions are in the project file too.

Code This "Array Coding 03"
A couple more routines that are not directly related to the videos, but use arrays and loops. True application here! Good luck.


07 NETBEANS GUI (Using Lists and Arrays)

Watch "Netbeans GUI Lists and Arrays"
How can you starting displaying arrays of values in your GUI? Using the awt.listbox. A quick introduction how to clear a listbox and then populate it with data from an array using a loop.

Watch "Netbeans GUI Lists and Arrays 02"
You want your user to be able to interact with the listbox you just added. User clicks, finding out what the user has selected, and setting the selected item in the listbox are covered in this video. A must for your final projects that involve lists of data.

 

08 ARRAY RESIZING (Adding, Deleting, Inserting, etc.)

Watch "Arrays Adding Values To End"
An array cannot be resized once it is made in memory. But the title of this section is array resizing?!?
This video will walk you through how to handle the situation where you want to increase or decrease the length of an array that you have made by going through the process involved with adding an extra value to the end of an array.
The diagram used in the video is in the documents folder.
The project used in the video is in the projects folder and contains a completed version and a blank version for you to practice with.

Try to Code - Deleting Value
If you understood the ideas in the previous video, there is a good chance you can code the Delete Button in the empty project provided. The delete button should read which index position the user wants to delete and then... wait for it... delete that index position from the array. Try this one on your own - if you get stuck you can watch the following video showing the solution.
This video uses the same project as the previous video!

Watch "Arrays Deleting Values"
Did you get stuck trying to delete index positions? This video is the solution. Skip it if you were you fine on your own.

Try to Code - Insert Value
Now try to code the insert value button in the project. Read the value the user wants to insert into the array. Read the index position at which they want the value inserted. Now 'wedge' the value into the array at the proper position! All the original values from the insert position onward should shift down in the array and no values should be lost. Good luck!
The nexts video is the solution to this challenge.

Watch "Arrays Inserting Values"
You want your user to be able to interact with the listbox you just added. User clicks, finding out what the user has selected, and setting the selected item in the listbox are covered in this video. A must for your final projects that involve lists of data.

Code It - Final Touches
Take your completed frame project that already adds, deletes and inserts, and add some final touches.

  • program should not 'break' when user enters index values that are inappropriate (hint: use return statements!)
  • when user clicks inside the listbox, the index value (ex. 0,2,6,8, ? ) is written into the two textboxes that the user uses to type index positions. This will make it easier for the user to select a location in the list to delete or insert into.
  •  

    09 FRIENDSBOOK PROJECT

    Project Time - FriendsBook
    Time to put some of the arrays, re-sizing, GUI (with listboxes and buttons) into action along with your coding expertise. This project will be a good review of many of the concepts learned. It will focus on array use and GUI use.
    1) In the documents folder find the project called Friends and give it a read!
    2) In the documents folder find the GUI Cheat Sheet that contains a list of some common methods that you will probably use in your project.

     

    YOU'VE LEARNED SOME BASIC PROGRAMMING CONCEPTS, NOW GO TO PAGE TWO!

    Page Two - A Fresh New Page
    This page is getting too long.
    You can jump to Page 2 from here, or at the top of this page just under the title...
    See you there!