UMBC CMSC104 CSEE

Computer Science Dept

CMSC104

Problem Solving and Computer Programming

 

Project 5 -- Chilling Temperatures

Due

Project 5 is worth 100 points and due at 11:59 pm, Tuesday, 16 May

Requirements

Create a file named jdoe2p5.c, using the editor of your choice.

This program will prompt the user for ten tempuratures. You must sort the tempuratures in the array in ascending order. Then calculate and display the average and median tempurature. Finally, print out the array (which is now in ascending order). Make sure that all tempuratures are in the range of -50 to 125, inclusive. If the user enters an invalid tempurature, make the user re-enter it until it is correct.

Compiling

Compile the program with the following command: If you get an error or warning, and you probably did, simply go back into the editor and fix it. Then recompile, continuing until you get no warnings or errors.

Executing

Execute the program with the following command: ./a.out

One Sample Output

(User input is in green.)
burt[123]: proj5/a.out
Enter a tempurature:  -115
The tempurature must be in the range of -50 to 125.  Please re-enter.
Enter a tempurature:  -234
The tempurature must be in the range of -50 to 125.  Please re-enter.
Enter a tempurature:  159
The tempurature must be in the range of -50 to 125.  Please re-enter.
Enter a tempurature:  8
Enter a tempurature:  44
Enter a tempurature:  -34
Enter a tempurature:  90
Enter a tempurature:  17
Enter a tempurature:  1
Enter a tempurature:  -1
Enter a tempurature:  124
Enter a tempurature:  -49
Enter a tempurature:  88
The average is 28.80
The median temperature is 17
 -49
 -34
  -1
   1
   8
  17
  44
  88
  90
 124
burt[124]:
  

Notice that the UNIX prompt must be on the next line!

Turning In Your Project

Once you have everything absolutely correct, you must use Blackboard to submit the project to the TA for grading. Do not email it to the instructor because you will lose points for not following instructions!

When submitting the assignment, I only want the file jdoe2p4.c. Please make the title and the file name the same when you submit it! If you submit a file named jdoe2p5.c, the way we save the material delete everything but the last file with than name. Therefore, your file will be lost and we will give you a zero!!!! Use your login ID!!!

Grading

This project will be grade using the following scale:

Documentation 25 points
Correct Results25 points
Correct Sytle25 points
Other25 points

You will lose 5 points if you do not name the file correctly.
You will lose 5 points if you email the project instead of submitting it via Blackboard.
You will lose 5 points if the prompt is not on the next line.

Comments Required

        /*****************************************************/
        /* Program Header Block                              */
        /* Filename:       jdoe2p5.c                         */
        /* Name:           Ima Student                       */
        /* Email:          jdoe2@umbc.edu                    */
        /* Date:           11 May 2005                       */
        /* Course/section: CMSC-104/0501                     */
        /* Description:                                      */
        /*     Analysis:                                     */
        /*         Input:                                    */
        /*         Output:                                   */
        /*         Constraints:                              */
        /*         Formulas:                                 */
        /*         Assumptions:                              */
        /*     Design:                                       */
        /*         (Your psuedocode goes here.)              */
        /*                                                   */
        /* Notes:          (As needed.)                      */
        /*****************************************************/
        

Function Header Comment Block (One for each function)

        /***********************************************************
         * Function name:    function_name                         *
         * Description:      (Your function psuedocode goes here)  *
         * Input Parameters: Name and data type of each parameter. *
         * Return Value:     Data type and description of what     *
         *                   the return value is.                  *
         ***********************************************************/
  


UMBC | CSEE |