UMBC CMSC104 CSEE

UMBC CMSC 104

CMSC104

Problem Solving and Computer Programming

Sections 0101, 0201 and 0601

 

Project 1

Due

Project 1 is worth 100 points and due at midnight, Thursday, 6 March.

Requirements

Create a file named 6789prj1.c (where 6789 is the last four of your SSN, using the editor of your choice. This program is to calculate the surface area and volume of a box. You will have to calculate the area for each of the six sides (2 times length times width, 2 times height times width, and 2 time height times length ) and add the results together. To calculate the volume, it is length times wide times height.
You will ask the user for the three dimensions of the box: length, width, and height.

Compiling

Compile the program with the following command: If you got an error 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 If everything worked correctly, you should get the messages giving the total surface area and the volume.

One Sample Output

(User input is in green.)
burt[107]: a.out
Enter the length: 12.3
Enter the width: 13.4
Enter the height: 14.5
The area is 1074.939941
The volume is 2389.889893
burt[108]:
  

Second Sample Output

(User input is in green.)
burt[112]: a.out
Enter the length: 23.98
Enter the width: 34.87
Enter the height: 45.76
The area is 7058.316895
The volume is 38263.710938
burt[113]:
  

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

Turning in your homework

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!

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:       6789prj1.c                        */
        /* Name:           Ima Student                       */
        /* SSAN:           6789                              */
        /* Date:           6 April 2003                      */
        /* Course/section: CMSC-104/0101                     */
        /* Description:                                      */
        /*     Analysis:                                     */
        /*         Input:                                    */
        /*         Output:                                   */
        /*         Constraints:                              */
        /*         Formulas:                                 */
        /*         Assumptions:                              */
        /*     Design:                                       */
        /*         (Your psuedocode goes here.)              */
        /*                                                   */
        /* Notes:          (As needed.)                      */
        /*****************************************************/
        


UMBC | CSEE |