Daily Blog - Wednesday, December 8th, 2010

Procedures And Functions.


     Today, I went for extra help with Mr. Arkin. It was really efficient and I now understand how functions work.   During class time we took up functions and I already knew how to do it. It felt good to know something and not have to worry about having to learn it.

     We learned a new keyword called procedure. Unlike a function it "speaks" as Mr. Arkin would say it. A procedure performs a defined task while a function returns a single value. These two keywords are very important to Turing and it is not really helpful that I know it.

     Here is a simple example of a procedure.


procedure sayHello (name : string)
    put "Hello, ", name, "!"
end sayHello
sayHello ("Victoria Windsor")

This short program fragment outputs the following, "Hello, Victoria Windsor!"

     Procedures are very interesting and can come in handy to any programmer at any level. An interesting fact about procedures is that their names must start with a Variable. For homework today we were assigned to do substring assignment 9a, and create a function for the nextConsonant and fully complete substring assignment 9a using functions. Luckily today I was able to finish it when I went for extra help. 'Yipee', no homework for today except the daily blog ofcourse.

     The last portion of the class was we had to get into groups of three where each person in the group had a different level of skill in programming. From 1-4 we were to distinguish ourselves and get into groups. I was a three and I got into a group of three. We were to discuss any trouble we had from the beginning of our programming unit.

     Well, that is all for today fellow blog readers. Until tomorrow.

Masseullah Adel

No comments:

Post a Comment