Reminder: for each class session and associated homework:
(20 points) With your pair-programming partner, complete the following two modules that you began in class:
These are both in today's Eclipse project 04-ReviewAndPractice.
Obey the pair-programming advice that we discussed in class. It provides:
(20 points — 10 for each module) Working individually (but getting help if you’re stuck), complete the following two modules that you may have began in class:
These are both in today's Eclipse project 04-ReviewAndPractice.
Window ~ Show View ~ Tasks
You will find that you need an IF statement. Informally, you want the body of your loop to say:
If the sine of this integer is less than x, make my count go up by 1.
In Python, you write that IF statement like this, assuming that k is your loop variable and count is your accumulator variable:
if math.sin(k) < x:
Put a statement here that makes count go up by 1.
Give it a try. If you have troubles with it, email
csse120-staff.rose-hulman.edu
Also, don't forget that you need (at the TOP of the module)
import math
for the sine function, if you write it in its long form as above: math.sin(...). Or you can do
from math import sin
if you would rather just write sin(...).
Turn in your work by committing it to SVN.