Test I, CSCI 230, Spring 2011


  1. [4 points] Describe functional decomposition.
  2. [6 points] Your roommate stated "User defined functions and procedures slow the program down, so we shouldn't use them." Comment in depth on this statement.
  3. [3 points] What problem does an enumerated type solve?
  4. [3 points] Give the syntax for declaring an enumerated type.
  5. [3 points] Declare an enumerated type to represent the months of the year.
  6. [3 points] Describe any code you would create to support the enumerated type in the above question.
  7. [3 points] What is a structure (struct)?
  8. [2 points] When should a programmer employ a struct?
  9. [3 points] Give the syntax for a struct.
  10. [3 points] Declare a struct to hold a standard date (day, month, year)
  11. [3 points] Describe any code that you would create to support the struct in the previous question.
  12. [2 points] Write a routine which will initialize your struct to Jan 1, 1970.
  13. [10 points] Write a routine which will take a string in the form Month-day-year and place the data in your struct. In this format Month is the full month name, day is an integer and year is an integer. For example, January-1-1970 is valid data. Provide code for any support routines used.
  14. [2 points] Describe the use of the typedef statement.