Showing posts with label classes. Show all posts
Showing posts with label classes. Show all posts

Saturday, October 6, 2018

Day 25: Emoji Class and the need for constructors

AP CSA
5th hour we corrected our worksheets.  That led to a lot of questions.  Thankfully I had some examples that helped answer these questions ready to go.  This helped us answer the need for setter and getter methods as well as why we want different types of constructors.  I stole these from someone on the internet.  I don't remember who, but they are not my own...




I wanted to do an "Emoji" class project, but that didn't happen in 5th hour.  They weren't ready for it.  6th hour was a bit more ready.  Still though, they needed a bit more hand holding and I think that was because I had an idea in my head as to how students would implement the task, but my directions gave students a LOT of room to implement the task the way they wanted.  I think on Monday we will need to do a bit more of "here is how we do one of the options" - now you do the rest...  I think the kernel of this lesson is good, it just needs some tweaking.  We are doing this in processing.




AP CSP
We started the "Need For Programming Languages" lesson from unit 3 today.  We did it in 20 minutes which was a bit of a rush, but I was still good with it.  I think the most important part of this lesson is to grab directions that are "ok" but still lack a lot of clarity.  Doing that task as a class helps pull out the big ideas here.  It went well in both sections as we could highlight the need for definitions for each arrangement.

Geometry
Students took a homework check.

One Good Thing
My PLC is keeping things afloat in Geometry and I appreciate that.

Day 24: Indepndent-ish practice with classes

AP CSA
I had students work on two different classes in BlueJ (Quadratic and Triangle) and gave them some unplugged HW.  I was gone during this hour, and it was clear when I came back, that there was still a lot of confusion around the client class and the main class.  I am surprised how many students write a TON of code, even when they are getting errors and then try to fix their errors all at the end.

Here was what their prompts looked like.  We did this pair programming style.

AP CSP
Ok... so... I am a bit mixed up on what happened on which day.  At some point (yesterday) we added things to our notebooks.  Today we took a MC test on units 1 and part of 2 (the non-compression) things.

A little aside: I am skipping the compression stuff, the "format showdown" and the "net neutrality" lessons at the moment.  I think we are going to get a TON of programming time this year.  I want to break it up with these other "non programming" tasks.  I think that will help keep programming interesting.

Geometry
We did the "race" activity.  Essentially students race for 4 rounds to put in accurate markings in each diagram given the information.  They fold the sheet of paper so they can only see one row at a time.  I really like this activity because it is "drill and kill" with out the pain.  Getting into the habit of (and knowing HOW to) mark diagrams is SO ESSENTIAL!

I still get a kick out of it when student come to me confused as to how to do a problem and they literally have no markings in their diagrams.  Like... huh?!

I cannot even do the problem without doing the markings.

One Good Thing
I presented to the superintendent today about Lunch and Learn.  This is a thing I am doing that is... a long story.  It is something I am passionate about, but it has also brought a ton of stress and heartache for me personally and professionally.  It was kind of a bittersweet moment.

Day 23: Switching to BlueJ

AP CSA
Due to class size, I switched up the lessons for each group here today.  In 5th hour we did a Pin class.  I did this same hook last year and it was good.   I also introduced UML diagrams to my 5th hour here since they didn't see it yet.



I wanted students to get a feel for more advanced classes and see it done in BlueJ.  We did this "code along style" and it seemed to work well.

In 6th hour, we created a UML diagram for a quadratic class.  Then students made it in BlueJ "pair programming style".  I just LOVE pair programming when students are first applying new concepts.  It forces them to talk it out and troubleshoot between two people before quitting or asking me.


NOW... here's the thing I am not sure I love about this idea.  It is super math-y.  It can be a super straightforward class, but if you don't remember how to do these algebraic things, it sounds impossible. SO... I am not sure if I would use quadratic again next year... I maybe could do linear equations (increasing, decreasing, find x intercepts, find y intercepts, etc.) . I would hope most students could do that.

AP CSP
Students worked on their favicon.  I showed them the google color picker to help them find creative colors.  They need to translate the 24bits/pixel hex values to 12bits/pixel which seemed to be a really good way to highlight misconceptions in the number systems lessons.  They posted to padlet when they were done.
Made with Padlet

Geometry
We started the lessons on segments in triangles.  Students were given different triangles with segments and asked to sort them into distinct, separate groups.  Then we talked about how they grouped them and put some vocabulary to the different types of triangles as we glued them into our notebook.




We did a few examples of problems on the board that use this vocabulary and then students got started on the homework as I showed them an example from each section of the WKST.

One good thing
I have a FANSTISC TA!  OMG he is so awesome.  Like seriously awesome.  He helped me cut out the triangles for geometry and in general gets to work as soon as he gets in the room.

Day 22: Let's talk classes - in Processing

AP CSA
Today we did an introduction to classes but with a programming focus.  I did this with all students.

I have a student in my 6th hour who is really doing independent study but knows a TON about Java.  As he left the room yesterday from my Mr. PotatoHead adventure, he said "I just don't think they (the students) get why you would use a class yet."  He was right.  Today we made that happen.

In processing, students always ask me "how do I make a circle"?  Really, they just make an ellipse, but this provided a good opportunity to talk about the "circle" class.

Together we developed a set of attributes a circle can have.  Some students mentioned "area" or "perimeter" as attributes, I threw those in as methods since we could derive them from the attributes.

In 6th hour, I had a method called grow(int amt) that made my circle increase a radius by an amount.  When we instantiated our circle in the runner class, students could see what the actual circle looked like in Processing.

Here was our runner class:
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
// runner class
// main method things - typically a runner class
Circle keegansCircle = new Circle();
Circle myCircle = new Circle(52, 100, 150);

public void settings(){
  size(500, 500);
}

public void setup(){
  keegansCircle.display();
  myCircle.display();
  
  System.out.println(myCircle.toString());

}

public void draw(){
  myCircle.grow(10);
  myCircle.display();
}

Here was our Circle class
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Class header
public class Circle{
  
  // class variables
  private float radius;
  private float xLoc;
  private float yLoc;
  
  // Constructor(s)
  
  // no-parameter constructor (default constructor)
  public Circle(){
    radius = 10;
    xLoc = 50;
    yLoc = 50;
  }
  
  // parameterized constructor
  public Circle(float r, float x, float y){
    radius = r;
    xLoc = x;
    yLoc = y;
  }
  
  // other methods
  public void display(){
    ellipse(xLoc, yLoc, radius, radius);
  }
  
  // setter or mutator method
  public void setRadius(float r){
    radius = r;
  }
  
  public float getArea(){
     return (float)(Math.PI * radius * radius); 
  }
  
  public String toString(){
     return "This circle has a radius of " + radius + " and a area of " + getArea(); 
  }
  
  public void grow(){
    radius = radius + 1;
  }
  
  public void grow(float rate){
    radius += rate;
  }
  
}

Here was the output:



We finished up the lesson with a "class foldable" which broke down the different vocabulary we saw that day.  Having the benefit of writing this post later in the week, I think I have seen these yellow foldables out almost every day.  Students use them and find them helpful.



AP CSP
Color Pixelization Widget!!!  I walked students through the first 3 challenges and introduced Hex.  Some students were very lost.  I think it would have been better to start with a blank screen in each of the 3 challenges and then re-created the pre-created colors.   For the second challenge (getting shades of a color) I had students do that themselves and then we debriefed it with a "secondary color" like yellow, cyan, or magenta.  That was a good activity to make sure students understood the content.

Also, for the third challenge, many students tried just doing "shades" of red.  I challenged them to make a "maroon red" an "orangey red"  a "magenta" - try to get DRASTICALLY different colors than just shades of the same color.

For the 5th "observation" students see that switching the bits per pixel ends with 2 bees.  It seemed like a "oh... huh" moment, but today my co-facilitator showed me this unplugged explanation of the 2 bees.  Essentially she drew a smiley face and then cut it into strips and put them next to each other like this...



... I thought it illustrated the point so beautifully.

Geometry
I have been thinking a lot about how to help geometry students be successful.  I think I am done giving them homework work time.  They don't use it.  If I make them do problems on the board, they do it.  That is practice.

I also have tried doing "one of each type of problem" from the homework together.  So then it becomes like a semi-collaborative-guided homework work time.  That might seem to work best.  Students also feel like they are getting "free answers" which is fine.

Today we re-learned some basic "here is what makes a triangle" sort of things.  I gave students an "exit ticket" to do on a whiteboard and told them they would get their homework after they were done with the problem correctly - this got good participation and students were eager to get it done and I was forced to see where each student was.

One Good Thing
I was comparing notes with another teacher about a student we had at separate times.  I have the student now, this other teacher had the student last year.  The student is one of my top participators in class.  They throw out ideas and seems engaged each day.  This teacher was surprised to know that since that wasn't the teacher's experience with the student in the year prior.  Sometimes I feel like we get frustrated that students do the same unproductive behaviors time after time, it was cool to see that this student had made progress over the prior year.  It also gave me motivation to tell the student "nice work" with participating.  I assume that is a new comment to the student which I think contributes to their self worth in class.