All these little things are important, but I think you need to spend more time thinking about how you are going to solve the problem. The computer is too stupid to do it, so you have to figure it out yourself first.
I say this all the time but I don't think anyone has ever done it that I haven't sat next to and forced them to: get out a piece of paper and a pencil and
write down and
draw what you understand about the problem.
Don't stop until you can solve the problem on paper. Once you know what steps
you took to solve the problem --only then can you tell the computer how to do it.
For this problem, the first thing I would do is draw a little sinusoid and mark it up. (Appologies for the badly GIMPed image.)

I drew three cycles, and I imagined that I wanted four samples per cycle. I then counted how many samples total there were: 12. If I want to take a sample at x=0 also then I would say 13 samples total. To recap for this example:
- the user asked for 3 cycles
- the user asked for 4 samples per cycle
- therefore, I need to write 3 * 4 (and maybe one extra for the beginning sample) to file.
Now I need to think about a little math. Each orange mark is a sample. That is, for some specific
x I can use my sinusoid function to get some specific
y, which the instructions say should be saved to file. Once I have asked the user for all the variables (
frequency,
amplitude,
phase, and
x), I can use these to make an equation that solves for
y. Since I must do it multiple times that suggests a loop (for step 7). The first three variables never change between samples. But
x must change every sample. Therefore, I should first calculate a new
x every time through the loop and then calculate the
y, and save y in the array.
Now I think about how I am going to save each sample: store it in an array. However, the professor asked that the array be created
before each collection of variables for the curve and that the array of samples be written to file
after going through the loop an unknown number of times (until the user answers 'n'), so where do I put each new collection of samples? You need to ask your professor if the loop isn't better put from steps 4 through 12 (instead of the current 5 through 9), or if each time through the loop the previous samples are to be lost (overwritten with the new samples for the new equation).
Hope this helps.
BTW. Tell your professor not to have you name arrays "array". You can get away with it in C (and some other languages too), but it is always a bad idea. Use a better name, like at least ArrayOfSamples or SampleArray.