DANVILLE AREA COMMUNITY COLLEGE
INTRODUCTION TO COMPUTER SCIENCE
MATH 110,    Fall 2008

          Homework 4  (Due Oct. 2 in class)

Solve the following Problems:
Problem (3-18):  (p. 230);
Problem (3-21):  (p. 231);
Problem (3-26):  (p. 231).
Hint:  (you don't have to follow this hint if you can solve these problems)                     (7) The main function needs only about 5 lines. You should know  how to call the function you defined.
                    (8) The intergerPower function needs another 5 lines.
Exam-2 on Oct. 9  (covers Chapter 2 and 3).
Part (A): are based on Chapter 2. (page 140-156)
            2.1 --- 2.15,
            and  2.24,  2.25,  2.34, 2.39,  2.42, 2.52,  2.61.

Part (B): a few programs, for example:
(type 1) To calculate alternating harmonic series:
                                 sum = 1 - 1/2 + 1/3 - 1/4 + 1/5 - 1/6 + 1/7 - 1/8 + 1/9 - 1/10 + 1/11.........
                                what is the sum if you uer 1M trems? if you sum infinit terms what should be  the limit of  the series?
                                 how many terms do you need to get a aum which only have +/- 0.000001error from the limit?.
(type 2) give you a function; your job is to use this function to solve a problem
(type 3) write a function first, and then finish the program, for example, your function can reverse any two digit number,
                   let the user  input  5 two digit numbers,  each calls the function.  So that, your output will be 5 numbers the
                   user inputted, but reversed,  say, if user input 34, the output will be 43, etc.

  ===================================