Forum: C++ Dec 9th, 2008 |
| Replies: 25 Views: 2,404 I'm now trying to write my stats to a text file, but its only writing two of the stats, and those stats come from the same function.
Heres the code -
#include <iostream>
#include <fstream>... |
Forum: C++ Dec 7th, 2008 |
| Replies: 25 Views: 2,404 Thanks a lot, that helps a lot. I'm on my last stat, I have to find the most commonly occuring word(s). Heres my function-
void commonWord(double count[], int array_length, words array[])
{... |
Forum: C++ Dec 7th, 2008 |
| Replies: 25 Views: 2,404 Ok thanks, now I'm trying to determine the average occurence of each words, I'm starting out by finding out how many of each word there is, heres my function-
void averageOccurrence(words... |
Forum: C++ Dec 4th, 2008 |
| Replies: 25 Views: 2,404 Ok, heres my revised code-
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <string>
#include <iomanip>
using namespace std; |
Forum: C++ Dec 4th, 2008 |
| Replies: 25 Views: 2,404 Thanks for all the input. I was able to store the lines with strcpy(). but now I'm trying to use strncmp to find out the number of unique words (or lines) in the text file. I tried a couple of... |
Forum: C++ Dec 3rd, 2008 |
| Replies: 25 Views: 2,404 Ok I figured out I need to use "inFile.getline(line,length)" instead of "getline(inFile, line)". I created a struct like stated early. However I'm having trouble storing the words from the text... |
Forum: C++ Dec 3rd, 2008 |
| Replies: 25 Views: 2,404 The maximum length of a word is 20, so the character array needs to be 21. The maximum numbers of words is 100, if there are more than 100 words I need to return a message saying something like "The... |
Forum: C++ Dec 2nd, 2008 |
| Replies: 25 Views: 2,404 Hey I have to write a program that reads a text file that contains a list of words, 1 word per line. I have to store the unique words and count the occurrences of each unique word. When the file is... |
Forum: C++ Nov 18th, 2008 |
| Replies: 8 Views: 966 Thank you! I think I finally got it. I also cant believe I missed such an obvious mistake by returning 1 instead of pos, the first time around. |
Forum: C++ Nov 17th, 2008 |
| Replies: 8 Views: 966 "Number" is the integer the user chooses for the number of values in an array (min is 3, max is 100). The random number generator function generates numbers 1-100, so they key is 1-100.
I'm not... |
Forum: C++ Nov 17th, 2008 |
| Replies: 8 Views: 966 OK I changed my search function, but I'm still not getting the right results. I assume the logic flaw is in the search function, not the coverage function. But I ran through it and could not find out... |
Forum: C++ Nov 16th, 2008 |
| Replies: 8 Views: 966 Ok thanks for the help. I was able to get the function where I had to print the three consecutive values in the array with the highest average. However I'm still having trouble on the percentage of... |
Forum: C++ Nov 15th, 2008 |
| Replies: 8 Views: 966 Hey I have this tough assignment that just keeps on getting harder and harder. I have 3 more functions to complete.
Function1:
I have to print the positions of the three consecutive values that... |