## Air Skimmers Project

Our next unit in Principles of Technology is the building of “air skimmers” for the intoduction into our second instructional unit – Energy and Momentum.

In this unit we cover the following TEKS:

(9)  The student describes and applies the laws of the conservation of energy and momentum. The student is expected to:

(A)  describe the transformational process between work, potential energy, and kinetic energy (work-energy theorem);

(B)  use examples to analyze and calculate the relationships among work, kinetic energy, and potential energy;

(C)  describe and calculate the mechanical energy of, the power generated within, the impulse applied to, and the momentum of a physical system; and

(D)  describe and apply the laws of conservation of energy and conservation of momentum.

Here are the parts for mine cut and ready. Planning to allocate a full 90-minute class to measuring, cutting, and drawing.

We’ll do assembly for the first half of the next class and then discuss the math and science behind what is going to happen.

The following class period, we’ll launch and see who goes the farthest and fastest.

## If/Then/Else If Versus Switches

Let’s examine the difference between using If/Then/Else If statements and Switch statements on a basic menu control object.

We are working with the structure of a previously built 4-function calculator that was constructed with If/Then/Else If statements similar to the following:

```//Program Name: 4-Function Calculator
//Programmer Organization: Ferris High School
//Program Date: Fall 2016

import java.util.*;
import java.lang.*;
import java.io.*;

public class calculator{
public static void main (String[] args) throws java.lang.Exception{
System.out.println("Basic Calculator");
System.out.println("2 - Subtraction");
System.out.println("3 - Multiplication");
System.out.println("4 - Division");
System.out.println("");

}else{
//Code if Other Integer Option is Selected
}
}
}```

Let’s compare the structure of the above with that of a Switch statement similar to the following:

```//Program Name: 4-Function Calculator (Switches)
//Programmer Organization: Ferris High School
//Program Date: Fall 2016

import java.util.*;
import java.lang.*;
import java.io.*;

public class calculator_switches{
public static void main (String[] args) throws java.lang.Exception{
System.out.println("Basic Calculator");
System.out.println("2 - Subtraction");
System.out.println("3 - Multiplication");
System.out.println("4 - Division");
System.out.println("");

case 1:
{
break;
}
case 2:
{
break;
}
case 3:
{
break;
}
case 4:
{
break;
}
default:
//Code if Something Different is Entered
break;
}
}
}```

Structurally, they both look about the same. Some of the first observations made are similar to “The Switch code is longer.” or “The Switch code has ‘break’ in it a lot.” or finally “I’m going to be thrown off that I don’t need curly braces in the default case of a Switch.”. All of these are good valid observations and concerns. Now, let’s look at why we even consider using the Switch construct.

Why Do We Care?

The primary reason we care is in the general processing speed of the application. When using an If/Then/Else If statement, the application must process each case until it finds the condition that is met. Once that condition is met, the conditional processing stops.

In contrast, a Switch statement creates a jump table that automatically jumps to the correct segment of code to be executed.

When Should I Use What?

If you have a construct that has two different pathways plus a default escape pathway, then an If/Then/Else If is typically considered the best choice.

Example – If/Then/Else If

```if (menu == 1){
}else{
//Code for Items Other Than Menu Options 1 or 2
}```

However, anything beyond two different pathways plus a default escape pathway is better suited by a Switch statement.

Example – Switch

```switch (menu) {
case 1: {
break;
}
case 2: {
break;
}
case 3: {
break;
}
case 4: {
break;
}
default:
//Code if Something Different is Entered
break;
}```

Which is More Efficient?

This is a bit of a loaded question. Some would say that efficiency is defined by how much typing and therefore “coding” is done on the front-end. In this case, the If/Then/Else If code at the top of this post has 755 typed characters while the Switch code has 787 typed characters. By this definition, the Switch code is 95% as efficient as the If/Then/Else If code.

If we define efficiency as speed at which the application runs, it depends on what data is input into the application at runtime. For example, if in the If/Then/Else If the user enters menu choice 1, the application processing time will likely be equal to or slightly faster than that of a Switch since menu choice 1 was the first condition to be checked.

However, if menu choice 4 is selected in the If/Then/Else If code, the application processing time will be longer than that of the Switch code since the conditional statement of menu choices 1, 2, and 3 had to be checked first since they were above the 4th menu choice in the code.

## An If – Then – Else Calculator

Today, in Computer Science, we applied the basics of If-Then/Else-If to build a 4-function calculator.

Students were instructed to create a basic calculator application that would first query the user which function they wanted to compute:

2 – Subtraction
3 – Multiplication
4 – Division

Upon selecting the desired function, the user would be asked to enter the numbers needed to perform the desired calculation. Upon entry of the requested data, the answer would be displayed in plain English.

In the end, the general program looked like the following…

```//Program Name: 4-Function Calculator
//Programmer Name: Eric Evans, M.Ed.
//Programmer Organization: Ferris High School
//Program Date: Fall 2016

import java.util.*;
import java.lang.*;
import java.io.*;

public class calculator{
public static void main (String[] args) throws java.lang.Exception{
System.out.println("Basic Calculator");
System.out.println("2 - Subtraction");
System.out.println("3 - Multiplication");
System.out.println("4 - Division");
System.out.println("");

Scanner firstNumber = new Scanner(System.in);
double firstNum = firstNumber.nextDouble();
Scanner secondNumber = new Scanner(System.in);
double secondNum = secondNumber.nextDouble();
double solution = firstNum + secondNum;
System.out.println(firstNum + " plus " + secondNum + " equals " + solution);
Scanner firstNumber = new Scanner(System.in);
System.out.print("Enter the First Number in Your Subtraction Problem_ ");
double firstNum = firstNumber.nextDouble();
Scanner secondNumber = new Scanner(System.in);
System.out.print("Enter the Second Number in Your Subtraction Problem_ ");
double secondNum = secondNumber.nextDouble();
double solution = firstNum - secondNum;
System.out.println(firstNum + " minus " + secondNum + " equals " + solution);
Scanner firstNumber = new Scanner(System.in);
System.out.print("Enter the First Number in Your Multiplication Problem_ ");
double firstNum = firstNumber.nextDouble();
Scanner secondNumber = new Scanner(System.in);
System.out.print("Enter the Second Number in Your Multiplication Problem_ ");
double secondNum = secondNumber.nextDouble();
double solution = firstNum * secondNum;
System.out.println(firstNum + " times " + secondNum + " equals " + solution);
Scanner firstNumber = new Scanner(System.in);
System.out.print("Enter the Total Number of Items You Wish to Divide_ ");
double firstNum = firstNumber.nextDouble();
Scanner secondNumber = new Scanner(System.in);
System.out.print("Enter the Total Number of Groups You Wish the Items Divided Into_ ");
double secondNum = secondNumber.nextDouble();
double solution = firstNum / secondNum;
System.out.println(firstNum + " divided by " + secondNum + " equals " + solution);
}else{
System.out.println("Make Valid Selection.");
}
}
}```

In the next class session, we’ll discuss using Switches vs. If-Then / Else-If statements and analyze when those are appropriate and when they are not.

## Mousetrap Racers

One of the projects that we do as part of Unit 1 – Motion in Principles of Technology is the “Mousetrap Racers”. These are the kits that come with basic materials for building a race car driven by a mousetrap. However, there are no directions.

In my case, students were working in groups of 2 and had 3 90-minute class periods to prepare their cars. They could use anything from within the classroom on their race cars.

Here are the pictures of their creations…

## It Is a Language Other Than English!

It has been a bit of a day, but we now have official word from Texas Education Agency that Computer Science I, Computer Science II, and Computer Science III are all considered as Languages Other Than English and therefore meet the LOTE requirement for students for high school graduation.

At the time of this writing, much of the information on the TEA website is out-of-date and refers to a September 1, 2016 deadline for when these courses no longer count as a LOTE credit. This was what generated much of the confusion.

For us, this means that this course must remain named Computer Science I and not Computer Programming. The difference is that Computer Science I is funded from the State of Texas Technology Applications / Computer Sciences budget while Computer Programming is funded from the Carl D. Perkins-backed Federal Career & Technical Education budget.

Regardless of funding source, we want to do what is in the best interest of our students and offering them an additional “foreign language” alternative is in their best interest. As such, it’s Computer Science I for this year.

## Water Bottle Rocketry

We started the school year in Principles of Technology with a bang – more like a blast!

The first project, right out of the gates, was soda-bottle water rockets. This was the introductory project for the course and for Unit 1 – Motion.

The class was broken into self-selected teams of 1 to 3. The class was given a complete 2-liter soda bottle and access to random materials from around the classroom. The teams were given 3 90-minute class sessions to brainstorm and complete their rocket designs.

Upon completion of the designs and following the launches, teams completed force diagrams and a post-launch analysis explaining why their rockets performed the way they did.

Here are the various rockets on the morning of the launches…

## Driving Finches

My Robotics class was busy for the past few days working in SNAP! to program the Finches to perform various tasks. We started off easy with some pre-programmed sequential instructions like the following:

We then quickly moved up to more interactive non-linear / non-sequential programming which allowed us to create basic driving functionality. Here were the fruits of their labors:

The students seemed to have fun working with the Finches and it gave them the flexibility to focus solely on the automation programming without having to also worry about the engineering design.

Special thanks to Birdbrain Technologies for loaning us the Finches this year for the students to work with!

## Easy as Pi

The basic LEGO Mindstorm EV3 truck we are using in this example contains two main drive tires and two smaller “bumper” tires. The balance of the weight is carried on a skid on the back-center of the robot. Each of the main drive tires are driven by a large motor. The task is to pre-program a robot to drive along the border of a 5 foot by 3 foot rectangle.

The main drive tires are the only one that we are interested in to solve this problem. First, we need to know the diameter of each tire. In this case, the truck is using 68.8mm diameter tires. We know the circumference of a circle is calculated by multiplying Pi (π) times the diameter or multiplying Pi (π) times double the radius.

C = πd or C = π(2r)

So, with a diameter 68.8mm, these tires have an approximate circumference of 216.14157mm. This means that for every full rotation of the tire, the robot moves 216.14157mm.

Now, let’s look at the length of our track. It is two 5-foot lengths and two 3-foot lengths. The converts to two 60-inch lengths and two 36-inch lengths. There are 25.4mm in 1 inch. As such, our track consists of two 1,524mm lengths and two 762mm lengths.

Unfortunately, we don’t luck out with our circumference evenly dividing into either of our lengths. This means that to stop at the exact length, the tire will not end at a complete rotation. We must calculate how many complete rotations and then how much of a fractional rotation would be needed for each length.

Let’s start with the 5-foot lengths. Remember, they are 1,524mm. Each complete tire rotation is 216.14157mm. So, we need to do some division:

1,524 ÷ 216.14157 = 7r11.00901

In common English, this means that to travel 1,524mm the wheel must rotate 7 complete times and then an additional 11.00901mm. The problem is how do we tell the computer to accomplish this task?

Option 1 – Fractional Rotations

In LEGO Mindstorm LabView, we can instruct the motor to turn a set number of rotations. In this case, we need to return to our division problem and solve for a floating decimal remainder

1,524 ÷ 216.14157 = 7.05093

This means that the motor will need to rotate 7.05093 times. If we double-check this, we multiply our answer (total number of rotations) by the circumference (distance traveled by each rotation) and should get our total distance.

7.05093 X 216.14157 = 1,523.99908mm

As we are working with approximations of π, a drift of 0.00091mm is sufficiently close.

Option 2 – Degree Rotations

In LEGO Mindstorm LabView, we can also instruct the motor to turn a set number of degrees. We know from earlier that we must perform a minimum of 7 complete rotations and then a fractional rotation.

To perform this calculation, we first need to know how much distance is traveled by a single degree of rotation. For this, we do the following:

216.14157mm ÷ 360° = 0.60039mm/1°

For every degree of rotation, the wheel will travel approximately 0.60039mm. So, to determine how many degrees are needed to travel 1,524mm, we divide that distance by the distance of 1 degree of rotation.

1,524mm ÷ 0.60039mm = 2,538.35007°

This means that to travel 1,524mm, the wheel needs to rotate 2,538.35007°. We know that this answer makes logical sense since we know from earlier that the wheel must complete just over 7 full rotations. There are 360° in a single rotation and 2,520° in 7 full rotations. This leaves 18.35007° to go.

Let’s double-check this. We calculated that a single degree of rotation produced 0.60039mm of travel. So, let’s see how much travel we get with 2,538.35007° of rotation.

0.60039mm X 2,538.35007° = 1,523.99999mm

As we are working with approximations of π, a drift of 0.00001mm is sufficiently close.

Let’s take a moment to look at the short length and see if the level of accuracy between rotations and degrees holds.

Let’s start with rotations again. We know that a single rotation gives us approximately 216.14157mm of travel. We also know that our distance to be traveled is 3 feet or 762mm.

762 ÷ 216.14157 = 3.52546

This means the motor will need to rotate 3.52546 times to travel 3 feet. If we double-check this, we multiply our answer (total number of rotation) by the circumference (distance traveled by each rotation) and should get our total distance.

3.52546 X 216.14157 = 761.99845mm

When working with rotations on the shorter distance, our drift is 0.00154mm. This would mean that our total drift for the entire rectangle would be 0.0049mm.

(0.00091 X 2) + (0.00154 X 2) = 0.0049mm

Now, let’s look at degrees for the short length. Once again, we know that a single degree of rotation gives us approximately 0.60039mm of travel. We also know that our distance to be traveled is 3 feel or 762mm.

762mm ÷ 0.60039mm = 1,269.17503°

This means that if the tire rotates 1,269.17503°, we should travel 3 feet. If we double-check this, we multiply our total distance per degree traveled by the total number of degrees of rotation.

0.60039mm X 1,269.17503° = 761.99999mm

When working with degrees on the shorter distance, our drift is 0.00001mm. This would mean that our total drive for the entire rectangle would be 0.00004mm.

(0.00001 X 2) + (0.00001 X 2) = 0.00004mm

Which is the Best?

Well, if we look at which option gives us the most accurate result, working with degrees resulted in an answer that is only a total of 0.00004mm off while working with rotations results in an answer that was a total of 0.00490mm off. That is a total difference of 0.00486mm.

If we are looking for ease of calculation, the number or rotations requires far fewer calculations and in theory less possibility for calculation error.

## A Local Robotics Competition

### Background

The way that we are establishing our Computer Programming curriculum is as follows:

• Year 1 – Computer Programming
• Language: Python
• Year 2 – AP Computer Programming
• Languages: JAVA & Ruby

### Our Problem

Because UIL uses JAVA as the basis for its Computer Science contests and TCEA uses JAVA as the programming language for their area robotics contests, there is nothing extra-curricular for the students in Year 1 of our program.

### Possible Solution

I am thinking that we will implement a local robotics competition for our first-year students using the LEGO Mindstorm EV3 kits programmed using Python to solve a given problem or set of problems.

I’ll need judges from around the local and larger community to judge creativity, engineering, and coding.

Eventually, I would like to open it up as an invitational format that could generate revenue for our robotics program and provide a small thank you gift for our judges.

## AP or No AP

### Introduction

This week, I have had the privilege of working with some outstanding educators from across the country at the UTeach: Computer Science Principles AP training held in Dallas, TX.

At this training, we were preparing for the newest addition by College Board to their general AP offerings: AP Computer Science Principles.

On the first day, the presenter stated that not all schools represented were going to be offering this for AP credit and I was stumped. I could not figure out why you would not present a course as AP if you could. However, as the week went on, I realized that my own campus is likely one of the ones that will not offer it as an AP course.

### Background (Course)

This course is built to be offered to students who would not typically take a Computer Science course. UTeach has based their curriculum on the University of Texas courseThriving in Our Digital World which is the mandatory Computer Science course for non-Computer Science majors.

### Background (My Students)

The students I will be starting with next year have all self-taught themselves JAVA as part of an after-school club. They participated on their own at UIL district competition and advanced to compete at UIL regional competition! These students have a strong desire to refine their skills in computational thinking and program development.

### The Problem

The AP Computer Science Principles course is language agnostic and primarily relies on block languages such as Scratch for its primary delivery. As my students have been working with a text-based language, this will feel like a substantial step backwards.

Also, the course will not adequately prepare my students for participation in UIL, which is JAVA specific. I feel that my students will derive more long-term benefit from preparation and participation in UIL than they would completing this AP course.

I am blessed to have an administration team at the campus and district levels who trusts my judgement to do what is in the best interests of our students. I have actually been told by one of my administrators, “My ego is not stroked based upon how many courses have the letters “AP” in front of them. Do what’s best for our students. That’s what I want and what I expect.”

### The Decision

Currently, the decision has been made that we will be offering the following:

• Computer Programming
• 2016/2017 (Not AP)
• Programming Language: JAVA
• 2017/2018 and Beyond (Not AP)
• Programming Language: Python
• AP Computer Programming
• 2017/2018 (AP CS-A)
• Programming Languages: Python, Ruby and Persistent Parallels to JAVA
• 2018/2019 and Beyond (AP CS-A)
• Programming Languages: JAVA and Ruby

The idea is that the students entering Computer Programming in 2016/2017 will be formally learning JAVA. In the next year, those students will progress to the second-year course, which is aligned with AP Computer Science-A and will cover the languages of Python and Ruby with persistent reminders of JAVA. Students in this group will be the UIL Computer Science team for both 2016/2017 and 2017/2018.

The students entering Computer Programming in 2017/2018 will be learning Python while learning computational problem-solving skills. In the next year, those students will progress to the second-year course, which is aligned with AP Computer Science-A and will cover the languages of JAVA and Ruby. Starting in 2018/2019, when these students enter the second-year course, they will be the UIL Computer Science team. In all future years, the team will be comprised of students from this second-year course.

### Long-Term Benefit

The hope is that students in this program will leave with truly marketable skills in JAVA, Ruby, and Python development.