MA 5490, Spring 2009
Professor Craig C. Douglas
Monday - Wednesday 1:20-2:35, Ross Hall 247
Notes   Homework   Syllabus

Quiz 1

Write your name on the front of your blue book if it is not already there. You will probably see your blue book again during the semester. Write clearly so I can read what you answer. This is a closed book, absolutely no electronic devices or other people allowed quiz.

  1. Read the quiz first and ask questions immediately if necessary (hopefully not).
  2. Write a main program that calls two functions and prints out what is specified in the next two points.
  3. Write a function that returns a double value representing pi, which is four times atan(1.0) and print the value on a single line in your main program.
  4. Write a function that gets an integer variable from the calling program as an argument, returns the given integer as a double, and increments the value of the argument by an integer that you read from the standard input stream (e.g., the terminal or a command line redirection) in a  way so that it really changes back in the main program. Your main program should print the function value and the argument's value (before and after the call).

All three of the programs should fit on one double sided page of the blue book if done correctly and succinctly. Comments and blank lines in the codes are unnecessary for this quiz.



Craig C. Douglas

Last modified: