CIS 71 (section 1): Homework 7

Handed out: 3/4/97
Due: by 2:30pm on 3/18/97
Email program to btrianta@thunder.temple.edu

This homework is similar to homework5.
Write a program that in a loop prompts the user to enter a text line and then reverses the line and prints out:

  1. The reversed line, and
  2. the reversed line replacing capital letters by lowercase letters and streaks of two or more spaces by single spaces.

The loop is terminated when the user just types a carriage return.

Here is an example of the interactions in a possible run:

Enter line [CR to exit] : Roses   are   VERY red
der YREV   era   sesoR
der yrev era sesor
Enter line [CR to exit] :    VioLETS ARE    Blue 
eulB    ERA STELoiV   
eulb era steloiv
Enter line [CR to exit] :

As a comment at the beginning of your program you should do a case analysis for this problem: problem statement, analysis, design, and testing.