CS100 - Assignment 7 (Programming languages)

(Section 001, Fall 2007)

All the questions carry equal weight.

  1. Briefly explain the pros and cons of compiled vs. interpreted languages.

  2. Give pseudocode examples for two simple functions, one that requires/uses value parameters ("pass be value") and one that requires/uses reference parameters ("pass by reference"). Briefly explain why you chose each.

Write pseudo-code, code, English or draw pictures to answer the following questions:

  1. Write the iterative solution and the recursive solution to the Factorial Series n! = 1 * 2 * 3 * 4 . . . * (n-1) * n

  2. Write the iterative and the recursive solution to count the number of times a user specified character appears in a string.

  3. Write the iterative and the recursive solution to determine if a string is a palindrome (reads the same forwards and backwards).



Gady Agam 2007-10-22