Showing posts with label Workshop 4. Show all posts
Showing posts with label Workshop 4. Show all posts

Thursday, June 18, 2009

Workshop 4: Puzzled

Have been going through the exercises for workshop 4 and am a little puzzled as to what is supposed to be happening with the adding values to the list. I get the list returned and nothing seems to have happened. (I think I just had an epiphany as I was writing this sentence.) It dawned on me that you need to specify the variable that you want to see. So you will see in the Image below that I have specified the value and got the expected result.


So the title above neesd to be changed to no longer puzzled.

I have looked at the challenge problems, and reviewed the code that Ken supplied. The exercises are relatively trivial and dont really provide much in the way of learning about Business Applications Development. Consequently I will not be spending time coding them.

Sunday, May 17, 2009

Workshop 4: Riding the Rails with Ruby

Topic objectives

  1. To learn about the Ruby language and its classes and methods;
  2. To use Ruby via an interpreter console window with Windows, Linux or MacOS
  3. To select and test a Ruby IDE
  4. To explain how Rails framework is built upon inheritance of Ruby classes and methods.

To do:

1. Spend some time moving your way through the 46 Ruby coding examples in the Ruby Tutorial with Code from http://www.fincher.org/tips/Languages/Ruby/

2. What are the syntax differences in the way that Ruby and Javascript use the if statement?

3. While Ruby and Python are quite similar, can you find some similarities between Ruby and Javascript?

Challenge Problems:

1. Create, test and debug a Ruby program called dognames.rb or catnames.rb to accept 3 names from the keyboard and to display each name on the screen in alphabetical order WITHOUT using a data structure such as a list.

2. Write a Ruby program called fizzbuzz.rb that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz".

3. Compare the Ruby and Python versions of the dog years calculator: