BIOS 546 In class exercises  #2

 

1. Write a program that takes user-entered lines and stores them in an array.  When the user enters "quit", the program prints out all the lines.  Call it "prog2_1.pl".

 

2. Modify program 1 so that it prints out the lines in reverse order. Call it "prog2_2.pl".

 

3. Modify program 1 so it first sorts the lines (ASCII order), then prints them out. Call it "prog2_3.pl".

 

4. Modify the program so it tells you how many lines have been entered, and then prints out only lines 2, 3, and 4. Call it "prog2_4.pl".

 

5. Write a program that adds up all the numbers between 1 and 50, and also adds up the squares of those numbers.  Have it print out the results.  prog2_5.pl.