UMBC CMSC104 CSEE

CMSC104

Problem Solving and Computer Programming

 

Project 1

Due

Project 1 is worth 100 points and due at midnight, 8 Oct.

Requirements

Create a file named jdoep1.c, 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 and add the results together. To calculate the volume, it is depth times width times height.

To calculate the area of a side, it is side_A times side_B. Sides A and B are the height, width, and depth, depending on which of the sides it is.
You will have to prompt the user from the dimensions of the box.

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.
Notice that the UNIX prompt must be on the next line!

Sample Output

The user input is shown in red.
Enter the height of the box: 2.3
Enter the width of the box: 3.4
Enter the depth of the box: 4.5
Surface area = 66.94
Volume = 35.19

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!

Grading

This project will be grade using the following scale:

Documentation 25 points
Correct Results25 points
Correct Sytle25 points
Other25 points

Comments Required

        /*****************************************************/
        /* Program Header Block                              */
        /* Filename:       jdoep1.c                          */
        /* Name:           Ima Student                       */
        /* email:          jdoe1@umbc.edu                    */
        /* Date:           6 Oct 2005                        */
        /* Course/section: CMSC-104/0101                     */
        /* Description:                                      */
        /*     Analysis:                                     */
        /*         Input:                                    */
        /*         Output:                                   */
        /*         Constraints:                              */
        /*         Formulas:                                 */
        /*         Assumptions:                              */
        /*     Design:                                       */
        /*         (Your psuedocode goes here.)              */
        /*                                                   */
        /* Notes:          (As needed.)                      */
        /*****************************************************/
        


UMBC | CSEE |