Programming Assignment #2
COSC 146

What to do: write a complete perl program that will find the average, high amd low scores for a bunch (how many ????) of quiz scores.
Specifically, the program should loop, asking for successive quiz scores. We assume all quiz scores are between 0 (zero) and 100. A negative number
will terminate the input loop.

Here's a sample run of a working program:


Enter quiz score 1 :    60            <------ Note: program output "Enter quiz score 1" and the user typed "60"
Enter quiz score 2 :    70            <------ Note: the program prompts for successive quiz scores by number!!
Enter quiz score 3 :    80
Enter quiz score 4 :    90
Enter quiz score 5 :    -1

The average is 75.0
The high score is 90
The low scores is 60

Please note that the user input (the numbers) occurred on the same line as the prompt for a quiz score. Your program should do
this as well. Also note that there is no limit on how many quiz scores may be entered.

Some hints:
- Since quiz scores are all in the range of 0 to 100, you should maintain two variable, $currentHigh and $currentLow, which maintain
the current high and low values encountered. For example, after inputting the first quiz score above (60), both $currentHigh and
$currentLow should have the value 60. After inputting the second quiz score (70), the value of $currentHigh should be 70 and the value of
$currentLow should be 60. Question: you need to initialize both of these variables: what would be good values ?
- You will need to maintain a counter that keeps track of how many numbers were entered. For example, a variable called $counter would have
the value 1 after the 60 was input, 2 after the value 70 was input, etc.

Extra Credit (add 5 points to your grade for this assignment)
I know a teacher that calculates a student average by giving 5 quizzes, dropping the lowest score and taking the average of the 4 remaining numbers.
Write a complete perl program that will:
-prompt for a student name
-prompt for 5 quiz scores (PLEASE NOTE: this is done with a loop!!)
- output the student name and the average as given above

The program should the ask for another student name and repeat. The loop is terminated if the user enters "STOP". Here is a sample run:

Enter Student Name : Jones
Enter quiz 1 : 50
Enter quiz 2 : 60
Enter quiz 3 : 70
Enter quiz 4 : 80
Enter quiz 5 : 90

Jones has an average of 75.0

Enter Student Name: Smith
Enter quiz 1 : 30
Enter quiz 2 : 40
Enter quiz 3 : 20
Enter quiz 4 : 50
Enter quiz 5 : 60

Smith has an average of  45.0

Enter Student Name : STOP