I need a little help getting started on an assignment that is due later in the week. I'm not asking y'all to do it for me, just a little help with the design of the program. Any tips are greatly appreciated. Thanks in advance for those who reply. Here is the general outline for the project:

Code:
Create a C program that performs the following:

Open an input file, "test.txt" (no quotes in the filename itself), and if 
successful, an output file, "test.out". If opening either file is
unsuccessful, an appropriate error message should be printed to screen
and the program should not execute any more tasks. You may not use exit() 
or abort(). Use selection to avoid executing. If the input file is opened 
successfully, it will not have errors. It will contain a seed value (integer)
for the pseudorandom number generator and the number of random values to 
generate (integer). 

The program must keep statistics of how frequently a number is generated
in the range [1,50] by using an array to count occurrences of each number.
Once the program has generated all numbers, it should create the output file
containing a report of the percentage of time a particular number was 
generated. It should print five values per line as shown below in Example 
Output. The more random numbers that are generated, the better the
distribution should become. Remember that your array subscripts start at 0.
I need to have prototype such as:

Code:
   bool openFiles(FILE **pFPIn, FILE **pFPOut);
I started to write the program earlier in the week, then picked it back up again today and became frustrated. I wasnt sure how exactly it should be set up. I'm just looking for general pointers on what to do as nothing I seem to be doing is working at all.

I was thinking this program would generally work like this.

Open Input File/Test -> Open Output File/Test -> Read SEED and number of generations -> Generate numbers and store them as an array -> Do the statistics on the array and write to output -> Displaying data in output file.

Is there an easier way to go about writing this? Can I just do it in two functions y'all think? With main calling the openFiles function where the magic happens?

I'm honestly stuck and appreciate any tips y'all can provide with this.

Here is what I had before I came online.
Code:
#include <stdio.h>
#include <stdbool.h>
#define SIZE 50

void displayName(void);
bool openFiles(FILE **pFPIn, FILE **pFPOut); 
void printResults(int arr[], int qrs);

int main(void) {

   int arr[SIZE], qrs;

   displayName();

//   openFiles(*FPIn, *FPOut);  ----- doesnt work for now

   printResults(arr, qrs);

   return 0;
}

//displays name
void displayName(void) {

   printf("\nName: XXXXXXXXXXX\n\n");
}

bool openFiles(FILE **pFPIn, FILE **pFPOut) {

   FILE *FPIn, *FPOut;
   int cInput;

   if ((FPIn = fopen("test", "r")) != NULL) {
   
       if ((FPOut = fopen("out", "w")) != NULL) {
        
          while ((cInput = fgetc(fpIn)) != EOF)
             fputc(cInput, fpOut);
          fclose(fpOut);
       }
       else
          printf("\nUnable to open \"out\" for writing.");
       fclose(fpIn);
   }
    else
       printf("\nUnable to open \"test\" for reading.");


}


// Just testing out arrays here and getting the column number down
void printResults(int arr[], int qrs)   {
   
   

    for (qrs = 0; qrs < SIZE; qrs++)
       arr[qrs] = qrs * 5;
      
   for (qrs = 0; qrs < SIZE; qrs++)
    {
       if (qrs % 5 == 0)
          printf("\n");
       printf("%4d", arr[qrs]);
    }
}