Here's an implementation for a Stack for int values in Java.
I include the following operations:
push
pop
peek
size
empty
Note that this video is a replacement for one I made a year ago. It had some mistakes I wanted to fix, so here's the improved ver...

From Brandon Grasley

A quick overview of the software design lifecycle - Conceptualization, Design, Implementation, and Distribution. Super-important: you'll move "backwards" often as you modify or refine your concept, design, and implementation....

From Brandon Grasley

It's usually helpful to have the logic of an application separate from the user interface. It's a form of encapsulation that simplifies design, implementation, and testing. Here's a small, cheap example....

From Brandon Grasley

The basics of documenting your code in Java. I show examples of single-line comments, multi-line comments, and JavaDoc....

From Brandon Grasley

You can use a pattern of 1,3,5,7,... to help quickly graph a parabola when a=+/-1. If a is not +/-1 you can multiply that pattern by a. For example, for y=2x^2, the pattern becomes 2,6,10,14,.......

From Brandon Grasley

Writing a "for" loop using input from the user. I'll show you how to print out the numbers from 1 to n, where n is the input value. I also show how to handle "bad" input from the user, like non-numbers or invalid numbers....

From Brandon Grasley

Finding intersections points between two lines using the Substitution method. Each example in this video has parallel lines, so there is either no intersection point (lines are distinct) or infinitely-many intersection points (lines are equivalent)....

From Brandon Grasley

Finding intersections points between two lines using the Elimination method. Each example in this video has parallel lines, so there is either no intersection point (lines are distinct) or infinitely-many intersection points (lines are equivalent)....

From Brandon Grasley

How experimental research is designed, using control groups and experimental groups. I talk about the Placebo Effect, blinding participants and researchers, dose-response curves, and some interpretation of results....

From Brandon Grasley

A short introduction to using UML to design a simple application. In this case it's a game. I talk about how UML works (i.e. what the boxes and arrows are for), and also about how it's good practice to separate application logic from user interface.
Apol...

From Brandon Grasley

I copied some pages for class today. First I made 25 copies of a single page. Then, I made 25 copies of two pages (50 total) and collated them (so pages A and B came out in sequence, then A and B again, and so on). How much longer does it take to use coll...

From Brandon Grasley

I show how to simulate 10 turns in each of two dice games for my MDM4U class. I'm using Google Sheets because it's fast and reliable. The same approaches work for Excel and Numbers, sometimes with slight differences in formula names.
My apologies for the...

From Brandon Grasley

Here's an application with a basic GUI in a JFrame with a button to open a file. Classes used:
JFrame, JButton, JLabel
BufferedImage
File
IOException;
ImageIO;
JFileChooser;
FileNameExtensionFilter;
This is leading into a larger task for my ICS4U class....

From Brandon Grasley

How to use exponent laws to write the product, quotient, or power of powers as a single power. I don't get into stuff like (x^2y^3)^2, though. Another time, maybe....

From Brandon Grasley