CIS 71: Homework 6

Handed out: 10/03/06
Due: by 10:00pm on 10/09/06
Email program to TA

Write a program that prompts the user to enter a sequence [terminated by 0] of at least 10 positive integers (but not more than 15). Then

  1. on separate lines it prints out the sequence [each integer is displayed in a 6 column field], starting at column 7 the sequence minus first and last element, starting at column 13 the sequence minus first two and last two elements, ...
  2. It reverses the sequence.
  3. It does again what done in step 1.

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

For example, if I entered the sequence 1,2,3 ,4 5,6,7,8,9,10, I should print out


     1     2     3     4     5     6     7     8     9    10
           2     3     4     5     6     7     8     9
                 3     4     5     6     7     8
                       4     5     6     7
                             5     6
    10     9     8     7     6     5     4     3     2     1
           9     8     7     6     5     4     3     2
                 8     7     6     5     4     3
                       7     6     5     4
                             6     5