CS 157 Spring 2001                       Assignment 10 – Arrays (and previous material)                                                               100 points

 

Assigned: 04/04/2001

Due: 04/11/2001 at the start of class.

Pre-Lab (Do Before Lab): Bring an empty (or nearly empty) disk (keep any .c files you create, but other files can be deleted). Plan out sequence of statements needed for program.

Main Assignment:

                Your have recently been hired as a professor and you need a program in order to figure out a curve for tests. The program should ask the user for how many students’ tests to keep track of (ensure that they give a number greater than 2 and less than or equal to 100), read in that many student test scores (validating each amount to ensure it is between 0 and 100 inches (inclusive)), calculate and report the “specialized middle average” test score, then report the curve (calculated as described below), and all students tests scores (with curve), with an indication next to all that are A’s ( 92 or above) (see example below). Lastly, show the number of  A’s out of the number of students, and the percentage of A’s (see example below).

Sample interaction with the user:

Welcome to Dr YourLastName’s Test Score Program

How many students? Please enter a value between  3 and  100  5

 

Enter score for student  1  Please enter a value between   0.00 and  100.00 ==> 103.5

Invalid Value !! Please enter a value between 0.00 and  100.00 ==> 99.5

 

Enter score for student  2  Please enter a value between   0.00 and  100.00 ==> 80.5

 

Enter score for student  3  Please enter a value between   0.00 and  100.00 ==> 78.0

 

Enter score for student  4  Please enter a value between   0.00 and  100.00 ==> 75.0

 

Enter score for student  5  Please enter a value between   0.00 and  100.00 ==> 70.5

 

Middle Mean is:  77.8

Curve is:  2.2

 

Student Grade Report:

      Student      Score             A

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

       1           101.7             *

       2           82.7             

       3           80.2             

       4           77.2             

5                72.7         

  1 of   5 students got A's. That's  20.00 percent

Details:

   1) Use doubles for anything that COULD be a non-whole number (e.g test scores, averages, ...)

   2) This is an exercise in writing and using C arrays. There are parts of the program that cannot be done without arrays. You can define an  array under the assumption that no more than 100 students  will be kept track of.

    3) We have covered functions, and generally I encourage use of functions - you should create and use at least 3 functions for this assignment. You may use functions for other parts of the task.

    4) The specialized “middle ave” is calculated by eliminating the highest and lowest score and then finding the mean of the remaining numbers.

    5) The curve is calculated by finding the amount that needs to be added to the specialized middle average to make it 80 (but subject to the constraint that the curve is only added – the curve should never be negative).

    6) Your greeting to the program user should use your last name instead of “YourLastName” (see below).

Miscellaneous:

    1) Make your program work like shown above. If you have any questions about what should be done, please ask!!

    2) MAKE SURE YOUR PROGRAM WORKS! (i.e. more than just removing compile errors). You can test your program on the above example, but make sure you test it on other data as well - I will! Your program needs to be able to handle any inputs including catching invalid inputs.

    3) Remember: Indentation, meaningful variable names, symbolic constants, and meaningful comments. Weaknesses in any of these could result in points off. You MUST include comments that explain your program in order to get full credit. Also make sure you put YOUR NAME, section, and e-mail address in comments at the beginning of the program.

Hand-in:

     1) Listing of the program

     2) Disk with  .c source file plus .exe executable file.  NAME YOUR PROGRAM FILE yourlastname10.c