Sunday, September 28, 2008

Small Code Cloze Excercises for Computer Science

1. Visual Basic (Random Number Generator):
The user inputs a range of two numbers: lowNum, highNum. From this input, the sub routine will change the lblNumbers.Caption value to a random number between the user-defined range (inclusive). If the code is ran again, we want the program to always supply a random number that is different from the first.

Bolded code would be deleted to assess student comprehension.
lowNum = txtLow.Text
highNum = txtHigh.Text

prevNum =
lblNumber.Caption

Do
randomNum = Int(Rnd * (
highNum - lowNum + 1)) + lowNum
Loop Until randomNum <>
prevNum

lblNumber.Caption = randomNum

2. Java (Determine the Sum of Each Digit from a 7-Digit Number):
Reviews division, modulus, and Math() functions in Java. Students have to try and determine a brute-force and a more elegant solution (using For-Loops) to solve the problem. While a bit "mathy," I think it gives students a chance to make connections as to why elegant solutions save programmers time and energy (e.g. How much code would you have to write to get the sum of a 20-digit number? Which version would be easier to modify?).

Bolded code would be deleted to assess student comprehension.
String inputString;
int digitString, digitSumLong, digitSumQuick;

inputString = JOptionPane.showInputDialog ("Input a 7-digit integer: ");
digitString = Integer.parseInt(
inputString);

// sum the individual digits the LONG way...
digitSumLong = digitString%
10 + (digitString/10)%10 + (digitString/100)%10 + (digitString/1000)%10 + (digitString/10000)%10 + (digitString/100000)%10 + digitString/1000000;

// sum the individual digits the QUICK way!
for (int i = 0 ; i <=
6 ; i++)
{
if (i == 6)
digitSumQuick += digitString/Math.pow(10,i);
else
digitSumQuick += (digitString / Math.pow(
10,i)) % 10;
}
That's all for now!

Wednesday, September 24, 2008

The Wiki has Landed!

The time has come!

The final touch is complete for my Web 2.0 assignment... The Wiki. You can click on this blog post's title, or go straight to Mike's Wiki Pages. But don't fret, I'll still be updating all the websites throughout the week (and weeks) ahead. That's the catch to this assignment.

Oddly enough though, now that all the pages are setup, I don't think it will be that difficult to set aside a few minutes week to add some C.S.-related links and keep everyone informed on my C&I assignment progress. I supposed I should mention what is on the Wiki that is different from the content on this blog.

Well for one, a blog is different than a Wiki. A blog is more an "on-line" journal that an individual can share is boring nonsense and drivel to the masses, or (hopefully) share some quality information about his/her field of work. A Wiki is more of a collaborative piece of software (kind of similiar discussion as my Google Docs post below) where many users - such as all the classmates in my C.S. C&I course - can share, edit, and collaborate creating content. And apparently "Wiki" means quick in Hawaiian, too.

Now that the technicalities are out of the way, lets talk about what my Wiki is all about:

I would consider it an extension to this blog. All of my reflections and any thoughts I have during my school experience or about my C.S. C&I course will be shared here and on Wiki I'll have shorter summaries of the information discussed here, as well as time lines, schedules and other plans to keep you informed as to what I'm working on. That is, if you really want to know what I'm working on. Really.

Using Google Docs to Learn French

I'm excited to talk about something I'm fooling around with right now as I take an intro French course at the University of Manitoba. Let me summarize my idea:


+ = Parlez-vous francais?


My question I'm asking in doing this "experiment" is this:

Can I use Google Docs sharing capability, to create a class-sharing community of fellow classmates who will help update a spreadsheet of vocabulary, and other important terms for our class?

So far, the results are hopeful:



The above is a screen-capture of the current "Vocabulaire" for my French class. I've only added about a dozen terms to the list. The rest, have been added by other classmates who I've "shared" this document with using Google Docs. It's very exciting seeing such an early implementation work so well. At the moment there are four of us adding new terms to help each other out with homework, quizzes, and tests.

The best part about this implementation, in my opinion, is the power to organize vocabulary by Chapter, Type (noun, adjective, verb), French, and English. Overall it's quite powerful and helpful to know about all the vocabulary we have covered so far -- instead of resorting to a huge dictionary that has way too many words than we need right now.

Actually, this could turn into a great P.D. idea if I can expand on this concept. Hmm...

And with that, bon nuit!

Tuesday, September 23, 2008

The First and Last Installment of The Chalk Dust Podcast

Just click on the link above or here (or even that big picture below) to listen whether or not you're one of 10 types of people on this world - and what this site is all about.
P.S. WebCT doesn't work if you want to share your podcast on Blogger. If you're still trying to upload your podcast go to Google Pages and use the file upload feature there. You get 100MB of storage with your Google account.