Select Page

C++ Programming Lock-In for Seriously Wannabe Geeky Students

@gentleman in obligatory geek gear

@rgentleman in obligatory geek gear

At my school, the Western Academy of Beijing, we don’t have a formal coding class although we do have many high school wannabe coders in our extra-curricular Geek Force club. This year the club members decided that their goal for the year was to learn how to code – and not just in any language but C++, a derivative of the mother of all programming languages (which to me is C).

So why C++? Firstly, our Geek Force know that C is widely used in gaming. Both C and C++ get you close to the silicon allowing for extreme optimization to maximize the resources available and make games slicker and faster. Of course, we realize that we won’t get to that level of complexity nor gain a really deep understanding at object oriented coding; however, by learning C or C++, we do know that it will be easy to pick up another language. Secondly, I used to be a C and unix programmer back in the day (yes, before C++ was even invented), so my personal challenge was to revisit C and pick up C++.

Arduino Challenge - rapid development to create a working product in limited time

Arduino Challenge – rapid development to create a working product in limited time

Learning to program takes time and, as we all know, everyone learns at a different pace. Some have programming experiences from dabbling in Python and HTML whereas others are complete novices. We decided to follow an online tutorial (C++ in 21 days) and set weekly targets for everyone to complete sections of the tutorial, but as we only had a weekly lunchtime slot, we found that, collectively, we were not making much progress. What was needed was a big chunk of time to really lay down the basics and learn together – hence the lock-in concept.

It takes some effort and programming experience to organize such an event and so I enlisted the help of@rgentleman, our Grade 6 MYP Design teacher, also a programmer in a former life. Our objectives for the lock-in were:

  • to have time to develop C++ programming skills
  • to have a friendly competition where everyone can compete no matter what level of expertise
  • and to have fun!

We organized 3 x 30 minute C++ challenges (sprints) with 3 x 15 minute team challenges in between each sprint plus some time for the obligatory pizza and diet coke! Surprisingly on a Friday night, we were joined by a number of budding geeks as well as two colleagues who wanted to join the competitive fun. Here is the link to the fantastic write up from Michael, one of our Geek Force Leaders.

And here are some examples of the programming challenges:

Basic: First Program HelloWorld.cpp

Watch this short youtube video [C++ Hello World using Xcode (Mac)] to create your first program Hello World. Modify the code to output your name and age:

Hello World. My name is x and I am y years old.

Intermediate: Currency Conversions (using nested if statements)

  • Input: Choice of currency (eg USD, RMB or one more of your choice), amount
  • Processing: convert from choice of currency to target currency (eg USD converted to RMB)
  • Output: amount in target currency (eg RMB)

Advanced: Currency Conversions (using switch statement)

  • Extend the above program to have a number of currencies (maybe up to 5) so that the user can select the input currency and the target currency.
  • Bonus points for using constants (which are declared in UPPER CASE
  • Bonus points for using an easy user interface (for example, enter 1 for RMB, 2 for USD…)

The Arduino Challenge

In random teams of 3 or 4, students were given an Arduino set and access to a large number of input and output devices (lights, fans, sensors etc). The challenge was to create something – they could use the internet and even download code – however they had to modify the code or the structure and be able to explain what they did.

If you would like to have access to the challenges, please contact me by email (madeleine_brookes at or madeleine at

Please note that this post has been cross-posted from my personal blog.

Related Posts

Submit a Comment

Your email address will not be published. Required fields are marked *

Share This


Managing Devices at Home: Conversation Starters & Family Media Agreement

You have Successfully Subscribed!


The Complete Guide to Designing Technology-Rich Units

You have Successfully Subscribed!


The Administrator’s Guide to Classroom Walk-Throughs

You have Successfully Subscribed!