Assignment 4

Due Friday, Oct 1, 04, by 12:00 midnight.

Write a program to ask the user to enter an entire input line from the keyboard. Then read this string (call it line) using getline. Then encrypt the string as follows: replace every character in line by the reverse of its ASCII position. Store the new string in a variable called encrypted. Then print encrypted.

Here are sample runs:

Enter a string (could be an entire line):

Sep. 4, 2004.

The encrypted line is:

3810121164232544230584842564

Press any key to continue . . .

================================

Enter a string (could be an entire line):

Iyad Abu-Jeib

The encrypted line is:

3712179001235689711544710150189

Press any key to continue . . .

=============================

Enter a string (could be an entire line):

3 < x <= 8

The encrypted line is:

152306230212306162365

Press any key to continue . . .