CMSC104

Problem Solving and Computer Programming

Section 0501

 

Project 2

Due

Project 2 is worth 100 points and due at 11:59 pm, 23 Oct

Requirements

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

You are a research marine biologist in Alaska, and you are studinyg salmon fish. You have to collect data on the weight each fish and then determine the weight of the heaviest and lightest fish and their average weight.

You must make sure that the user enters a number of fish that is greater than zero. Also the weights must be greater than zero. If the weight is 40 pounds and 8 ozs, the weight should be entered as 40.5 pounds.

Remember, no fish are to be hurt as a result of this study.

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.)
How many salmon are in the sample:  4
Enter the weight of fish #1: 43.5
Enter the weight of fish #2: 53.8
Enter the weight of fish #3: 53.85
Enter the weight of fish #4: 26.1
The number of salmon in the sample was 4
The average weight for the sample was 44.31
The heaviest salmon was 53.85
The lightest salmon was 26.10
  

The UNIX prompt must be on the next line!

Turning in your homework

Once you have everything absolutely correct, you must use Blackboard Digital Dropbox 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 jdoe2p2.c. Please make the title and the file name the same when you submit it! If you submit a file named jdoe2p2.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:       jdoe2p2.c                         */
        /* Name:           Ima Student                       */
        /* Email:          jdoe2pl@umbc.edu                  */
        /* Date:           14 Mar 2005                       */
        /* Course/section: CMSC-104/0501                     */
        /* Description:                                      */
        /*     Analysis:                                     */
        /*         Input:                                    */
        /*         Output:                                   */
        /*         Constraints:                              */
        /*         Formulas:                                 */
        /*         Assumptions:                              */
        /*     Design:                                       */
        /*         (Your psuedocode goes here.)              */
        /*                                                   */
        /* Notes:          (As needed.)                      */
        /*****************************************************/
        


UMBC | CSEE |