Parallel Arrays in programming

in #array8 years ago

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

Coin Marketplace

STEEM 0.04
TRX 0.32
JST 0.083
BTC 60791.27
ETH 1560.80
USDT 1.00
SBD 0.47