Friday, March 27, 2015

Morse Code Project

Project ideas come from all sorts of places. Textbooks, other teachers I work with, blogs, random conversations, conferences (do you know about Nifty Assignments from SIGCSE?) and more. Some of the best come from students. Not always intentionally though. The other day I caught a student playing around on a website while I was lecturing. Apparently I wasn’t doing enough to hold his interest. The website converted letters to Morse Code and back again. There are probably many of these sites on the Internet. My first reaction was that this makes a good programming project. (Does that make me weird?) So we started talking about it as a class.

Student’s first reaction was “that’s hard” and “I don’t know Morse Code.” But of course it’s not really that hard to implement if you know how to use arrays. The tedious part is building an array to use for conversion.

            Morse[0] = ".-";
Morse[1] = "-...";
Morse[2] = "-.-.";
Morse[3] = "-..";

I've decided to do that for my students. After all I want them to use the array not go crazy trying to build one.

Converting from ASCII letters to Morse Code using a string array like this is a simple and fast operation. Big O(1) for access. We’ve already done some work like this writing a program to count the number of times various letters occur in a string. Going the other way, from code to ASCII is a little harder.

In that case we have to do a search of some kind though the array. A simple sequential search is probably the easiest way to do things. I know there are other ways. We could create a hash which would probably be faster. Or a nice binary tree (see this method – Thanks to Rebecca Dovi for the link).

These methods would be more complicated though and this is a first programming class. So we’ll talk about other ways to do it and maybe in the AP Class they’ll implement something faster and/or more complicated.

We will have a good chance to talk about the various performance issues and the various ways that arrays can be searched. I’m looking forward to the discussion.


Wednesday, March 25, 2015

FizzBuzz Revisited

I first blogged about using FizzBuzz in the classroom four years ago when I didn’t have a classroom and students of my own to use it with. (FizzBuzz–A Programming Question) Well times have changed and today I did assign the project to a room full of students.

Briefly stated the exercise is:

Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”.

Most of my students finished it easily during the shortened period we had today. A few in a very short period of time which is great. I should say that these are not yet experienced programmers. We are not even half way though a one semester course. Though we have covered loops and decision structures. So they know the concepts but haven’t had a lot of practice by any means. So I’m pleased with the results. What pleases me the most is that the solutions are not identical.

There are at least three different ways students set up the if statements to determine what to show when.

  • Check for evenly divisible by both 3 and 5 first.
  • Check for evenly divisible by 15 first
  • Check for divisible by 3 but not 5 first and 5 but not 3 second.

They all work of course. The last one, while more complicated, demonstrates a good grasp of compound comparisons. That is sort of a plus.

In my project instructions I asked students to display the results in a listbox. We’re not doing command line programs and haven’t covered file usage yet. We have used listsboxes though. A number of students wrote code that always adds the number to the listbox but then removes it if it is not necessary. Again a bit more complicated and probably slower than other solutions but interesting since I did not teach them how to use the Remove method for listboxes. Clearly someone (or several people) is looking things up. That also makes me happy. I like students to go beyond what is covered in lectures. Plus this is an implementation that for some reason never occurred to me. Who know but that may turn out to be helpful to me some day. I learned something knew and I love learning new things from my students.

Tomorrow we’ll talk about the various solutions and I will have the students explain why they choose the methods they did. Hopefully we can have some discussion about the performance aspects as well. Should be fun.

EDIT: I went looking for an image to post with this article and found one that suggested a visualization of FizzBuzz. I may assign this one next time.


Divisible by 3 is blue, divisible by 5 is red, and divisible by both 3 and 5 is green.

Tuesday, March 24, 2015

Madeup: a Programming Language for Making Things Up

One of the things I have been wondering about is how to make a real connection between 3D printing and learning computer science. Sure most 3D printers are attached to computers and CAD software is used to create models for printing. That is not quite computer science to me. And it sure isn’t programming. Recently I learned about a project to create a language to program 3D models for printing. It looks interesting even though it is still under development.

Chris Johnson at the University of Wisconsin, Eau Claire is working on it and it is called Madeup. Madeup is a Logo-like language that can be used to “walk paths through 3D space, and then generate models based on those paths. Previews of the models are rendered on every keystroke in a WebGL canvas.”

Chris has a KickStarter ( to raise some funds to allow him more time to finish the project up so that it can be used in classrooms. I’ve contributed a small amount so that I can get an early copy for my own use.

I think the 3D renderings alone will make things more interesting than 2D graphics but being able to create a physical representation is really exciting to me. Take a look at the video on the KickStarter and let me know what you think. Does this look useful to you?

Monday, March 23, 2015

Interesting Links 23 March 2015

Some great links this week. Images to use in class, a video for a TV show (yes about girls computing), and lots more. One of my best collections in recent weeks if I do say so myself.

Program Computers, Not Kids is a great post by Vicki Davis aka @coolcatteacher Key line?

If you see technology controlling students, then you’ve got a classroom using 21st century technology for 20th century teaching. If you see students creating and programming the technology, then you’ve got a more modern classroom approach.

XNA is no more but as the phoenix rises from the ashes MonoGame, may be the replacement. the next generation . Check it out for multi-platform game creation. And a way to continue to use any XNA curriculum you may have.

iD Tech and are giving 100 Girls Scholarships to Attend Summer STEM Program See the web site for more information

Zoomable map of undersea cables connecting the world of the Internet. Great as a topic of discussion. Ask students why Bermuda has so many connections. I suspect it is because of money. Bermuda is a world-wide center of international reinsurance.

Late last week I posted a large collection of questions to use while interviewing candidates for Computer Science teaching jobs.

Are you using Scratch? You may find these printable graphics of Scratch commands useful.

Embedded image permalink

The TV show Road Trip Nation is looking for a couple of people between 18 and 30.

Roadtrip Nation and Microsoft are teaming up to send 3 young people with backgrounds that are underrepresented in the technology industry and who are interested in computer science on a cross-country adventure to discover the exciting--and growing --possibilities in the industry. Selected individuals will travel in Roadtrip Nation’s Green RV, and will interview professionals all over the country who have turned their passion for computer science into fulfilling careers. The experience will be filmed and will appear on Roadtrip Nation's long-running documentary series, which follows young people all over the world as they seek to figure out their futures. More information at Roadtrip Nation: Code Trip Application 

Early wearable computer: Qing Dynasty abacus ring. You know it’s cool!

Embedded image permalink

Is this sort of plot addition to a TV show the answer? Made with Code - Cierra Ramirez: via @YouTube

Embedded image permalink

Friday, March 20, 2015

Interview Questions for Computer Science Teachers

As I looked into why several posts from a while back were getting so many page views lately I realized that search values similar to “interview questions for computer science teachers” were probably responsible. The two pages in question are two where I interviewed CS educators about themselves and their work. That is probably not what most of these searchers were looking for though. Since it has been a while since I interviewed for a computer science teacher position (as either hiring manager or job hunter) I went to social media looking for examples of good questions for job interviews.

People were very helpful. I quickly received dozens of questions. I’ve got the whole list below but I wanted to focus a bit on a few I felt were key. Oh and if you feel a question is missing or have thoughts on any in the list I would to read about it in the comments.

A couple relate to teaching in general.

  • Do you like kids? You’d better if you want to do a good job teaching. Kids know if you don’t like them and they will not respect you if you don’t like them.
  • Are you ready / willing to share your "war stories" with the class, to help humanize the subject?  This is important to me. I think teachers should make teaching personal and that means sharing your own history.
  • What strategies would you use to help struggling students? Everyone learns differently and the great teachers are not the ones who help the students who get it easily but the ones who help the struggling students.
  • I walk into your class..describe to me what's going on and why. Are they going to fit in with your school? Are they ok with a noisy class? That’s my favorite. Or do they favor the sit and get method of teaching?
  • What approaches will you bring to the classroom to make this subject matter worth learning?   Relevance may be an overused work in some circles but it is still important.

Some are more Computer Science related. Well at least somewhat.

  • What strategies would you use to attract and retain women and minorities in your program? If they don’t know this is an issue and haven’t thought about strategies for it they may not be ready.
  • Why are you passionate about CS? I think passion is huge. And it can’t easily be faked.
  • Why teaching instead of industry? Do I need to say more?
  • Explain the role of ethics within your CS program. With the massive changes that computing is making on society today having ethics being someone a teacher thinks about and addresses is important to me.

Here is the full (mostly unedited) list I received from a number of helpful teachers. It’s in no particular order.

  • What strategies would you use to attract and retain women and minorities in your program?
  • Experience in CS
  • what projects you have done in college
  • why are you passionate about CS
  • Teaching and tutoring experience at which levels.
  • What's your vision for the CS program here, what part do you want to play
  • what resources do you need,
  • which classes should we teach.
  • Why teaching instead of industry?
  • How would you explain what a ZIP file is?
  • What are the common misconceptions about nested for loops?
  • What have you learned from a student?
  • Pick a language and tell me why it's the best language for our students. Now tell me the challenges of using that specific language with these students, and how you would overcome them.
  • Students at this school need some help with <concept/skill>. Tell me how you would use your CS class to help them.
  • I walk into your class..describe to me what's going on and why.
  • How have/would you balance individual, pair and group assignments?, How does this impact assessment of your students' progress?
  • Explain the role of ethics within your CS program.
  • What strategies would you use to help struggling students?
  • How would you keep the students off Facebook and games during class?
  • One area is attitude and skills
  • Do they like kids?
  • How would you connect your curriculum to real world problems and core curriculum ?
  • In what ways can your program increase students overall problem solving and critical thinking skills?
  • Can they relate to age group of the students
  • Can they communicate?
  • Do they like to learn? Are they excited about learning? Are they still actively learning?
  • Are they disciplined? With themselves and in the classroom. Can they mange their time?
  • Not only can they teach but do they like to teach?
  • Do they have high expectations?
  • Do they know the tools (Windows, MacOS , IOS, Android)
  • Can they program?
  • Do they know the software?
  • Can they handle large classes
  • Is there 1-on-1 coaching
  • Can they make a lecture interesting?
  • Are they flexible in classroom environment
  • Are there self-paced classes and can they work with that?
  • What approaches will you bring to the classroom to make this subject matter worth learning?
  • Why is Grace Hopper worth knowing about?
  • What do you do when you've got a kid who, despite repeated attempts, just doesn't get it?
  • What was your favorite part in the movie "The Imitation Game"?
  • Are you ready / willing to share your "war stories" with the class, to help humanize the subject?
  • In your opinion, how does CS apply to everyone's every day lives?
  • What does "rigorous computer science curriculum" mean to you?
  • How would you implement a rigorous computer science curriculum while ensuring that students who have no prior computing experience can have a class that is both rigorous and accessible?
  • What are the most important topics to teach the beginning computer science student and why?

Wednesday, March 18, 2015

Do You Want To Write Some Code?

OK I feel better. I was overcome with an urge to write some code. Now I have a program I should write. I want to combine my seating chart program (with pictures) with the program I use to randomly pick on students. I mean randomly pick who to call on. Whoops. But I don't have the time to work on that right now.

So I wanted a "toy program." I remembered that I had been playing with a simple Caesar cipher program  (who else remembers ROT-13?) What I have long been meaning to do was to write a program that took a string and rotated it though all 25 possible rotations (26 puts it back the way it was) and build a list so that if you suspected a Caesar substitution you could test it to see how it was rotated. Fine.

So I took the code for rotating in the encoding program and made it a simple little string function. Added a loop to pass a string to the function with different values to rotate and put the result in a listbox. By reusing code I was done in about 10 minutes. And I have a toy program I will probably use once every couple of years and could probably find a web app that does the same thing in about the same time it took to write the code. But oh so much more satisfying. image

Who knows - I might assign it as a programming assignment someday as well. BTW Mike Zamansky has a closely related (and probably more useful post) on his blog  Rot13 - Gateway Drugs Techniques

Tuesday, March 17, 2015

2015 CSTA Administrator Impact Award Nominations Open


Dear CSTA Community, 

Nominations are currently open for the 2015 CSTA Administrator Impact Award! This prestigious award is given by CSTA to recognize an administrator who has made an outstanding contribution to K-12 computer science education. 

The winner will be presented with the Administrator Impact Award during the CSTA 2015 Annual Conference, July 12-14 in Grapevine, Texas. The winner and the nominating teacher will receive registration, travel, and accommodations for the CSTA 2015 conference. The award winner will also be featured in an article in the CSTA Voice and recognized on the CSTA website and Advocate blog.

Award applications open today, Monday, March 16 and will close on Sunday, April 5 at 11:59 pm Pacific Time.

Teachers are asked to nominate an administrator they believe has demonstrated significant impact on computer science education in their school, district, or state. The award winner's work must be shown to have broad impact and influence, and to demonstrate leadership in a variety of ways, including innovative approaches, mentoring of teachers, and visionary thinking.

Submit your nomination now!

For questions regarding the Administrator Impact Award, please contact