# Help with C++ Parallel Arrays Program



## Pammer020 (Nov 29, 2007)

Hello everyone, im new to this forum and i have a program that i am currently working on(well trying to anyways) that i am having very difficult in doing. I am in a first year C++ class. I am to write a program that will process the work done by Santa's evles. For each elf, there is a line conaining the name of the elf followed by a line containing the number of toys the elf made for each of teh last 5 months. I am to read this data into two parallel arrays. These arrays are an array of strings for the elf names and a 2-D array where each row contains the values for the one elf. 

I am to create a parallel array of integers. This array will store the total number of toys per month made by each elf. I am also suppose to use that array to find the total number of toys made and to count the number of elves who made more than 100 toys. Also i need to find the elve who made the most. 

The output should print a report labeled showing name, number of toys for each of the five months, and total number of toys made by each elve. It must show the total number of toys made, the number of elves who made more than 100 toys, and the elf that made the most toys and how many toys that elve did make. 

This program is to be made only out of functions. Nothing should be in int main() expect for function calls and declarations. Each array should be passed threw each function. 

This is the data file for all the elves.

Smiley
23 45 55 66 77
Curley Locks
12 33 87 44 55
Clementine
12 12 12 12 12
Jasper
44 66 34 12 2
Lucinda
8 7 5 6 4
Buddy
9 34 22 55 6
Florence
34 55 66 77 88
Dorothy
20 30 40 10 40
Snowflake
13 12 11 10 9
Bernard
22 33 44 55 66
Judy
12 23 34 45 56
Chuckie
5 3 8 9 10
Frosty
100 29 33 4 2
April Day
33 32 31 30 0
Merry
91 92 93 49 95
Sunshine
5 4 3 2 1
Carol Song
45 22 11 43 55
Misty
13 16 17 18 19
Harold
0 9 8 7 6
Krissy Kringle
0 1 0 2 0

Any help would be very appreciated. I was doing very well with my programming until I had to input from files and started using arrays.


----------



## Pammer020 (Nov 29, 2007)

Here is what the functions should look like.

The input function should open the file, read all the data from the file
using an eof loop and close the file. While reading the data, count the
number of elves you read from the file (that will be len for the arrays).

I should have several calculation functions - one will calculate the
total number of toys for each elf and a grand total for all elves. Another
one will find the elf that made the most toys (a findMax type function).

I also will need a print function to print all the required data.


----------

