Home Work 3: Arrays, Strings and Pointers

Project 5
From homework 2
Project 8
Write a program to count the number of words in a sentence. We will define a word as any sequence of the letter of the alphabet or digits 0 to 9 that ends with the following characters:

A space ()

A comma (,)

A period (.)

An exclamation point (!)

A question mark (?)

Project 9
Write a C program using a function summatrix() that accepts two two dimensional arrays (matrices) and returns the sum.

Project 10
Encryption is one of the most commonly used techniques for secure communication of data. The original text, called the plain text is converted into a cryptic text called cipher text using a cryptographic key. One encryption scheme works as follows: Select a key word (its size can be any number of characters). Each letter is assigned a number (say a=1, b=2, space=27, etc.). To generate the first encrypted character, convert the first letter in the plain text and the first letter in the key to its number equivalent. Add these two numbers. If the number exceeds 27, subtract 27 from it. Look up the letter equivalent of this number.

For example: plain text is ``word'' key word is ``key'' Assume the numbers are assigned according to their alphabetical order.

To generate the first character of the cipher text, first add the number equivalent of ``w'' to that of ``k'' which is 23+11 = 44. Since it is greater than 27, subtract 27. This would result in a value of 17, whose letter equivalent is ``q.'' Therefore, the first character in the cipher text is ``q.''

When you move to the second letter in the plain text, use the second letter in the key word. When you reach the end of the key, start over with the first letter of the key.

Write a program to derive cipher text from plain text using the above encryption algorithm. You may select the key word length of your choice.

About this document ...

This document was generated using the LaTeX2HTML translator Version 96.1 (Feb 5, 1996) Copyright © 1993, 1994, 1995, 1996, Nikos Drakos, Computer Based Learning Unit, University of Leeds.

The command line arguments were:
latex2html -split 0 -html_version 3.0 hw3.tex.

The translation was initiated by Vijay & on Thu Mar 5 10:02:53 EST 1998


Vijay &
Thu Mar 5 10:02:53 EST 1998