clip_image001

Welcome to Coding Corner-this is a regular column about computing and coding in the classroom. Written by Dan Aldred (@Dan_Aldred) who is well worth a follow on Twitter. Dan’s article is about his students use of programming to solve problems.

One student arrived on Monday lunchtime and stated that he was giving himself half a hour to program a solution to find a random number between 1 and 1000 based on a formula, that the user enters in.

Minutes later a Year 7 student arrived and wanted to share with me the game he is creating, a simple role-playing game using an RPG design interface. A set of predefined Ruby coding blocks are dragged onto the window to add actions to a charter or the scene. http://www.rpgmakerweb.com. This student is entering his game for The BAFTA games competition. He has also built a lot of KUDOS with the Yr 11 students who see him as some kind of genius!

clip_image002

Both examples involve coding, both create a solution; one requires the user to remember the code the other presents the user with pre coded tiles they drag in. However the principle feature is that it requires both creators (the students) to think through the outcome they want to achieve and then combine small steps to create the solution

The first step in the “find a random number” solution is to code the user to allow them to enter in upper and lower numerical limits. The thinking through of this problem allowed the student to identify what input was required, then applied the appropriate code.

upper = int(raw_input("Enter an Upper Limit (whole number): "))

lower = int(raw_input("Enter an Lower Limit (whole number): "))

I think the thinking process is what makes programming so important. In some ways it doesn’t matter that the student does not know all the code required to perform a function as long as they know what the function they require is. Many students struggle with this process. One student in an ICT lesson was required to discuss the advantages and disadvantages of social networking sites for a report. I promoted them to think about their own experience of using Facebook. However after two minutes or so I found the student on Google typing in the phrase, “advantages and disadvantages of social networking”. I informed them that they need to explain why the advantage was positive and not to just state the advantage, guess what? They typed in, “Why is making friends an advantage of a social networking site?”

To return to my point, students have become accustomed to looking for answers or in essence regurgitating facts and data that they find on a web site. This method of learning is great if you have a photographic memory and can recall them all, but most learning does not take place in this fashion.

Paradoxically, for such an Internet dependent generation, Felix Baumgartner was broadcast and streamed live all over the Internet and out of a class of 31 students only one watched it or knew who he was.

Programming helps to re-ignites the flames of thinking and challenges students to question and reflect. Perhaps the great philosophers may have been great coders?

Random number search program in Python coded in 30 minutes.

import random

import parser

import time

## Python Trial and Improvement

upper = int(raw_input("Enter an Upper Limit (whole number): "))

lower = int(raw_input("Enter an Lower Limit (whole number): "))

step = int(raw_input("Enter an increment for the search (whole number): "))

previous = int(raw_input("Enter the starting value of the search: "))

formula = raw_input("Enter the formula in python format. Replace the x with r :")

formulaC = parser.expr(formula).compile()

target = int(raw_input("Enter the target value (whole number): "))

print "The equation is " + formula + "=" + str(target)

print ""

print "———————————————-"

found = False

rounds=0

while(found==False):

r=previous+step

previous=r

if(r>upper):

print "Unable to find value in the range given"

found=True

rounds=rounds+1

print "Trying: "

print r

value= eval(formulaC)

print "Value of equation is"

print value

if(value == target):

print "Found the value of r it is "

print r

found = True

print "———————————————"

print "Summary"

print "———————————————–"

print "Number of rounds to find r: "+str(rounds)

print "Value of r is " + str(r)

 

Why not try some of this programming at home?

Dan’s new website has some brilliant ‘How to’ programming guides http://itecdigital.weebly.com/

clip_image004

Dan Aldred is a teacher of Computing and Head of IT. He is also a member of the school extended leadership team and teacher learning group.  He’s interested in how technology and software move learning forward.

Written by Julian S Wood - www.ideasfactory.me/about/"rel="author"
About me
UK Primary School Future Learning Technologist.I am into Experience and Fun Based Learning.I use web tools to stimulate writing. I've been Playing and Learning since 1970. Have some fabulous ideas now & again.. Check out my about.me profile!
Click Here to View All Nominated Educators
My LinkedIn Profile

To see my LinkedIn profile, click here:

Julian S Wood
edublogs-nominated-bestindivtweeter-150x150
Subscribe
Email subscription to blog
Map
Privacy Policy
Privacy Policy - www.ideasfactory.me

Privacy Policy for www.ideasfactory.me

If you require any more information or have any questions about our privacy policy, please feel free to contact us by email at skyblue_jules@talk21.com.

At www.ideasfactory.me, the privacy of our visitors is of extreme importance to us. This privacy policy document outlines the types of personal information is received and collected by www.ideasfactory.me and how it is used.

Log Files
Like many other Web sites, www.ideasfactory.me makes use of log files. The information inside the log files includes internet protocol ( IP ) addresses, type of browser, Internet Service Provider ( ISP ), date/time stamp, referring/exit pages, and number of clicks to analyze trends, administer the site, track users movement around the site, and gather demographic information. IP addresses, and other such information are not linked to any information that is personally identifiable.

Cookies and Web Beacons
www.ideasfactory.me does not use cookies.

DoubleClick DART Cookie

.:: Google, as a third party vendor, uses cookies to serve ads on www.ideasfactory.me.
.:: Google's use of the DART cookie enables it to serve ads to your users based on their visit to www.ideasfactory.me and other sites on the Internet.
.:: Users may opt out of the use of the DART cookie by visiting the Google ad and content network privacy policy at the following URL - http://www.google.com/privacy_ads.html

Some of our advertising partners may use cookies and web beacons on our site. Our advertising partners include
Google Adsense

These third-party ad servers or ad networks use technology to the advertisements and links that appear on www.ideasfactory.me send directly to your browsers. They automatically receive your IP address when this occurs. Other technologies ( such as cookies, JavaScript, or Web Beacons ) may also be used by the third-party ad networks to measure the effectiveness of their advertisements and / or to personalize the advertising content that you see.

www.ideasfactory.me has no access to or control over these cookies that are used by third-party advertisers.

You should consult the respective privacy policies of these third-party ad servers for more detailed information on their practices as well as for instructions about how to opt-out of certain practices. www.ideasfactory.me's privacy policy does not apply to, and we cannot control the activities of, such other advertisers or web sites.

If you wish to disable cookies, you may do so through your individual browser options. More detailed information about cookie management with specific web browsers can be found at the browsers' respective websites.