Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Visual Logic - parallel arrays


  • Please log in to reply

#1
mystical63

mystical63

    New Member

  • Member
  • Pip
  • 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 ???

Thanks in advance
  • 0

Advertisements


#2
Ax238

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

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP