CS 1620 Assignment #5 Fall 2000

How to handin.
Points : 50
Due : Thursday Nov 2, 2000 @ midnight
Note : Late assignments will be accepted only with the instructor's pre-approval.
Marks will be awarded for comments, style, readability, compiling and working correctly.
All programs should loop until the user wants to quit.
  1. [10] In the kingdom of Houlihan, people write differently than us, in the sense that they write "w" instead of "h", except when it is preceded by "t", and inversely, they write "h" instead of "w", except when it is followed by a vowel. Zahra, a friend of yours, frequently receives e-mail messages from a Houlihan friend of hers, Alien68. As Zahra gets tired of translating her e-mail messages, she asks you to write her a function that translates Alien68's messages. You are asked to be nice to her and write a function that will help her to read her messages. Your function should take a string as input and return the decoded string. Write a driver to test your function.

  2. [10] Programming problem 2 page 353 in textbook. Write a driver to test your function.

  3. [10] Problem 2, page 287 in textbook

  4. [10] Problem 8, page 289 in textbook

  5. [10] The value ex can be approximated by the sum:

    1 + x + x2/2! + x3/3! + . . . + xn/n!

    Write a function that takes a value x as an input parameter and returns this sum using n = 100. Write a driver program which will ask the user for a number, x as input, and calculate and print the value of ex using both your function and the function exp from the cmath library.

    Recall that n! = n x (n-1) x (n-2) x . . . x 3 x 2 x 1

All programs should loop until the user wants to quit.
Assignment List | Next | Prev | Computer Science 1620
Department of Mathematics & Computer Science
University of Lethbridge Home Page