EXAMPLE

Growth of a Bank Account Determine how long it will take to accumulate at least $10.000 in a bank account if you deposit $500 initially and $500 at the end of each year. if the account pays 5 percent annual interest. Solution Because we do not know how many years it...

EXAMPLE

Series Calculation with a while Loop Write a script file to determine how many terms are required for the sum of the series 5k2 – 2k; k = I, 2, 3…. to exceed 10,000. What is the sum for this many terms? Solution Because we do not know how many times we...

EXAMPLE

Series Calculation with a for Loop Write a script file to compute the sum of the first 15 terms in the series 5k2 – 2k, k = 1.2.3….. ,5. Solution Because we know how many times we must evaluate the expression 5k2 – 2k. we can use a for loop. The...

EXAMPLE

Plotting with a for Loop Write a script file to plot the function: Solution We choose a spacing dx = 35/300 to obtain 301 points, which is sufficient to obtain a smooth plot. The script file is the following: Note that we must use the index k to refer to x within the...

EXAMPLE

Analysis of Temperature Data The arrays temp_A and temp_B given in the table contain the water temperature in degrees Fahrenheit of two ponds measured at noon for JO days. Determine how many days the temperature of pond A was above 60′. On what days did this...

EXAMPLE

Volume of a Circular Cylinder The volume of a circular cylinder of height h and radius r is given by V = π r² h, particular cylindrical tank is 15 m tall and has a radius of 8 m. We want to cons another cylindrical tank with a volume 20 percent greater but having the...