I was wondering if someone could please look at this and tell me if I have it even close to being correct. I also have a problem with the code to make the program read the words from the file. Here is what I have so far.

Code:
#include "stdafx.h"
#include <iostream>
#include <string>
#include <fstream>
using namespace globalType;
void printResults();
print word_count(std::string);

int find(std::string[], int word_count, std::string a_word)
    {
        for(int i=0; i < word_count; ++i) if(words[i] == a_word) return i;
        return-1; // did not find word

    }


 
int main()
{
    const int MAX_WORDS = 100;
    std::string words[MAX_WORDS];
    int words[100][length of longest word +1]
   

    
    std::ifstream("SelectWords.txt");
    while(file >> words[word_count]) ++word_count;  //word_count contains number of words read
    int words[100][30];
    int word_count[100]={0}; //initialize to zeros

    

    int pos = find( words, word_count, word_read_from_file);
    if(pos != -1) ++word_count;  //if found, increment the count

    system("pause");
    return 0;
}

INSTRUCTIONS:

Read the words from a file named “SelectWords.txt” into a 100-element array of strings.
Declare and initialize to zeroes a parallel array of whole numbers for word counts
Declare and initialize to zeroes a parallel array of doubles for word frequencies.
Declare two strings to hold the shortest and longest words in the data file. Initialize the shortest word to “thisisarunonsentencewithlotsofletters” and the longest word to “a”.
Declare a whole number variable to hold the total word count, and initialize it to zero.
Open and read one of three data files, provided by the instructor, examining each word as it is read.
If the word matches one in the SelectWords array, increment the corresponding count in the parallel array of whole numbes.
If the word is shorter than the word currently in the ShortestWord string, replace the contents of that string with the word from the data file.
If the word is longer than the word currently in the LongestWord string, replace the contents of that string with the word from the data file.
Increment the TotalWordCount by one for each word read from the data file.
After all words have been read from the data file, calculate the frequency of occurrence of each of the SelectedWord’s by dividing its count by the TotalWordCount, and save the calculated value in the corresponding element of the array of doubles.
Display the name of the data file, the shortest word, longest word, and total word count.
Display the arrays of SelectedWord’s, their counts, and their frequency of occurrence in a columnar fashion. Format the frequency of occurrence with 2 significant digits and a field width of 6 characters.
For bonus credit: Declare an array of at least 30 integers and initialize each of them to zero. Use each to accumulate a count of all the words of that length. For instance, array[5] should hold a count of all words that were read from the data file that had a length of 5 characters. After all other output is complete, display the contents of this array, formatted as “N words of length M”, substituting the count for N and the array index for M. Do not display word lengths for which the count is zero
http://cboard.cprogramming.com/image...AAAAAAAAAAAA== PasswordBox

is connecting you automatically http://cboard.cprogramming.com/image...AAAAAAAAAAAA== PasswordBox

is connecting you automatically