Parallel Arrays in programming

karadura(25)
Published in
#array
Words
93
Reading
1 min
Listen
Play
9y

Here is an example of an parallel array for a program to store a day and the budget for that day.
ArrayExm1232018.png

The pseudocode for this parallel array will be something like this:
Constant Integer SIZE = 7

Declare String days[SIZE]
Declare Real budgets[SIZE]
Declare Real totalBudget
Declare Integer index

For index = 0 To SIZE - 1
Display "Enter the day of the week", index + 1
Input days[index]
Display "Enter the budget for today"
Input budgets[index]
End For

For index = 0 To SIZE - 1
Display days[index], ": ",budgets[index]
End For

Parallel Arrays in programming | Ecency