C for yourself
#include <%lt;stdio.h>>
#define kenyan 0
#define mzungu 1
int skinTax(int customer){
if (customer == mzungu){
return 50;
} else {
return 20;
}
}
int main(){
printf("Maize = %d Beans = %d\n", skinTax(kenyan), skinTax(mzungu));
}
I just gave this program to stage II in their C class. Skin Tax is something one of the serving volunteers in Kenya (now returned to the UK but she mentioned volunteering again and going to China!) told us about in our first week in country: getting charged that little more because you are perceived to be wealthy and too stupid to know better.
Meanwhile stage IV are still as bad as ever: half way through my C class this morning I ran out to check the syntax of #define and there, in the staff room, was my colleague:
“I just walked out of my Stage IV class”, she said, “I told them they should come for me when they are ready to talk to me”.
And when my C class was over, I went back to the staff room and she was still there.
“Did they come for you?”, I asked.
“No! And I have a class with them tomorrow and I won’t go to that either.”
I’m kinda pleased its not just me, but what the hell is going on here with these ladies?

Raj Says:
That bit of code you gave is not very "safe" is it ? what happens if I call skinTax(2), I presume I would be treated as a Kenyan even though I’m not !, I supposed that is the "next" lesson when you tell then about the switch() command (or is that goto ;))
Anyway you missed a non typical bank-holiday Monday here in Blightly - it did not rain (where I am anyway) until the Evening, so the afternoon air was rich with the smell of barbeques. Mind you you proabably have real barbeques over there, none of this charcoal nonsense
TTFN Raj.
June 2nd, 2004 at 6:03 pmMark Says:
Safe? Dunno. (I thought you were going to tell me it was open to buffer overrun and was preparing to be amazed yet again by how crap C is).
Safety is hadly an issue: you should see the exams!
I showed the SkinTax program to the colleague who used to teach this subject. He exclaimed:
"You’re on Functions already!!?".
I explained that I had taught functions early (before assignment statements even, does this betray my background in Haskell?) because I thought the objectives were:
a) to teach them how to program, and
b) to teach structured programming
He told me where to find the past papers; here’s a sample:
* Briefly describe the procedure you would follow to develop a program solution for a problem that is already defined/stated for you.
* Briefly describe the following methodologies used in designing structured programs:
- Top down development
- Structured Theorem
- Modular design
* Describe the evolution of programming languages in terms of generations
* A program is required to read and multiply two numbers, The porogam then outputs he result.
- Write an algorithm to implement this solution
- Write a C program solution
* Explain any five qualities of a good program
**sigh** Oh well.
I’m off home to have a shower and listen to Bill Bryson narrating a Brief History of Nearly Everything.
June 2nd, 2004 at 6:52 pm