CMSC 104
Sections 103/105/401
Programming Project One

Boxes

Assigned: Monday 3/29/99
Due: Before Midnight Monday 4/5/99

The Objective

The objective of this assignment is to get you started writing programs in C in the UNIX environment. This project will give you practice using arithmetic operators, printf() for output and scanf() for input

The Task

Your assignment is to write a program that will input the dimensions (length, width and height) of a box. Your program wil then calculate and display the surface area and volume of the box.

Your program should input the dimensions as integer feet. You may assume that the user will input only positive values. Your program does NOT need to validate the input.

Be sure that your program has a file header comment that includes

  1. the name of the file
  2. your name
  3. the date the file was written
  4. a description of your program
  5. your algorithm or pseudo-code to solve the problem

Your program must adhere to the coding standards and indentation styles discussed in class.
Be sure your project is well commented.
See course syllabus for project grading guidelines and university policies concerning sharing of code.

Sample Output

retriever[102] a.out Please enter the length of your box: 5 Please enter the width of your box: 4 Please enter the height of your box: 3 The volume of your box is 60 cubic feet. The surface area of your box is 94 square feet. retriever[103]

Although your output need not be identical to the above, all information must be present.

Submitting the Program

Your C source code file for this project MUST be called proj1.c.
To submit your project, type the following at the Unix prompt:

submit cs104-103 proj1 proj1.c

To verify that your project was submitted, you can execute the following command at the Unix prompt. It will show all files that you submitted in a format similar to the Unix 'ls' command.

submitls cs104-103 proj1