Code.org Week 1 Notes

Lesson 2 Java Lab

  • Class header and main method
  • "ClassName" should be replaced with the filename
public class ClassName {
    public static void main(String[] args) {
    
    }
 }

Lesson 3 The Neighborhood

  • Defining an object

    • ClassName objectName = new ClassName()
    • Example:
      • Painter myPainter = new Painter();
  • Objects have attributes which are characteristics of an object

  • A class is the blueprint that objects are created from. Instantiating an object calls the constrcutor to create an object.
  • A constructor is code that has the same name as the class and tells the computer how to create a new object

Lesson 4 Navigating and Printing

  • Parameter: a variable in the method/constructor signature that defines the type of value to receive when the method or constructor is called
    • in the definition of a function
  • Argument: a value passed to a method/constructor when the method or constructor is called
    • when calling the function

Lesson 5 One-Way Selection Statements

//if statement syntax
if (condition) {
    //do this
}

Week 2 Code.org Lessons: 6-15

Lesson 6

  • super is a keyword used to refer to the superclass
  • constructor signature is the first line of the constructor that includes the public keyword, constructor name, and values to specify when an object is created
    • public class myClass{}
  • inheritance is an OOP principle where a subclass inherits/extends the attributes/behaviors of a superclass

Lesson 7

  • method signature is the name and parameter list
    • public void methodName () { }

Lesson 8

  • while loop
  • while (condition) {}

Lesson 9

  • control structure is a conditional/iteration statement which affects the flow of a program

Lesson 10

  • if (condition) { }

else { }

  • ! ("not" operator)

Lesson 11

  • print statements help to debug

Lesson 12

  • pseudocode helps to plan algorithms

Lesson 13

  • An edge case is a bug that occurs at the highest or lowest end of a range of possible values or in extreme situations

Lesson 14

  • Practiced creating subclasses extending a superclass

Lesson 15

  • Check for understanding