CEG221: Advanced C Programming for Engineers

Homework 1

 

PURPOSE: This assignment is to help familiarize you with the beginning steps of taking a problem and turning it into a computer program. The stages are:

1)      Understanding the problem / Background information

a.       During this stage, you should use diagrams (where appropriate) and words to describe the problem

2)      Determining a solution for a specific case

3)      Generalizing the case, using functions, variables, and constants where appropriate (don’t worry about data types here)

4)      Assigning data types to function return types, variables, and constants

5)      Writing pseudo code

 

This assignment will help you focus  on steps 1-3. You are to

(1) find an engineering problem to solve (it can be from Physics, statistics, etc. – it doesn’t matter as long as it is not an example from class, my lecture notes, or my web site); if you haven’t found one, you are to solve the “gorilla problem” placed on the board

 

(2) describe the problem in your own words

 

(3) generalize the problem using variable names (ie. for the height of the two buildings, the velocity of the exploding banana, etc.) and describe what each variable name represents

 

(4) break down tasks into functions

 

(5) implement one of the non-trivial (5 lines or greater) functions from (4)

 

This assignment will be worth 40 points, and will be graded partially on correctness of the process (35 points) and partially on the correctness of the solution (5 points).

 

Good luck.