You've got period and frequency confused (easy to do since they're closely related). Period describes how long it takes for the pendulum to complete one full cycle, while frequency describes how many cycles the pendulum will complete in a given time. Period is measured in seconds, frequency in cycles/second (aka hertz).

in your case:

frequency = 10 cycles / 8 seconds = 1.25 cycles/second

period = 8 seconds / 10 cycles = 0.8 seconds (the cycles disappear from the unit because period is defined as "the time to complete one cycle")

Dimensional analysis is your friend with physics word problems. If you aren't sure whether to multiply or divide, go with the one that makes the units come out correct. For example, if a problem gives you a distance and a time, and asks for velocity, and you know that velocity = distance/time, regardless of how confusing the problem is there's only one way to put the numbers together to make the units come out right.

As for the graph, distance can't be negative, but displacement can. At rest, the pendulum hangs straight down (zero displacement), you pull it to the right (positive displacement) and let it go. It swings back to its starting point (zero displacement) and keeps going (into negative displacement). The cycle repeats. It all depends on what you choose as your reference point (zero). Usually physics problems choose the "at rest" state as the origin of the graph. By sketching the graph from 0cm to 40cm you're putting the origin at the point where the pendulum is just about to swing back the other way. Given the wording of the problem, your graph isn't wrong, though a teacher might take off points because it doesn't follow the convention.