SIBT COMP 125

Week 2 Practical Exercises

  1. Write a program in Eiffel that will print Hello World to the screen.
  2. Modify your Hello World program so that it reads a name from input, and then prints Hello, name.
  3. Examine the FizzBuzz program. Modify it so that it prints "FizzBuzz" for numbers divisible by both 2 and 3.
  4. When the program gets to 6, it should print "fizzbuzz".

  5. Modify the FizzBuzz program so that it prints "fizz" for each time 2 goes into the number, and "buzz" for each time 3 goes into the number.

For example, when the program gets to 4, it should print "fizzfizz". When it gets to 12, it should print "fizzfizzbuzz".