Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works

# Visual Logic - parallel arrays

### #1 mystical63 Posted 16 December 2007 - 11:37 PM

mystical63

New Member

• Member
• 2 posts
I have 2 parallel arrays .. one containing names (first only) the second contains sales amounts for these people.
The first array has duplicate names .. ie. Brian, Brian, Graham, Graham, etc. (yes same people and need to be entered this way.
The second array containing associated sales amounts... \$10, \$5, \$1, \$6 etc.

I need to produce a report that says Brians sales are \$15 and Graham's sales are \$7, etc

Then I need a report that says.. Brian had the largest sales.

Here is my pseudo code so far

There are a total of 17 elements in each array Data is read from 2 files in another procedure

Total = 0
For k = 1 to 17
If Seller(k) = Seller(k-1)
Total = Total + Sales(k)
else

Total = Total + Sales(k)
Output:
"Total sales for " & Seller(k) & " " & Total
Total = 0

The output that I get is

Total sales for Brian \$10
Total sales forGraham \$1

Its only reading first dollar amount
Its not accumulating the totals by individual
any thoughts ???

• 0

### #2 Ax238 Posted 17 December 2007 - 02:13 AM

Ax238

Tech Staff

• Technician
• 1,323 posts
Hello mystical63,

What is this for? If it is for a homework assignment, you won't be able to receive any help here. If this is the case, your best options are to consult the textbook, a classmate, or the teacher/professor. The only advice I can give you in that case would be to follow the logic, either on paper or in your head, and determine what is happening at each step.

Regards,

Ax
• 0

### Similar Topics

#### 0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users