![]()
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.
===================================