Hi all,
I'm not sure if this is the appropriate place to ask for assistance with a homework problem - Programming Logic and Design - using Raptor and pseudocode? I'm not asking for anyone to do my homework for me, I just don't understand how to set up part of the program to use the elements in an array to perform calculations on those elements.

I'm struggling to get through this class and the projects are coming at me faster than I can absorb the concepts - it's an all online course with an instructor that is difficult to get in touch with.

Anyone willing to assist?

Emily

Anyone willing to assist?

Willing yes, but not capable with such a vague description of what you want to do and the problems you're having.

Or are you talking about this Raptor? If so, maybe this link could explain how you access an array element in Raptor.

Hi again, this is the problem I am working on:

I've been given a file with data that I load into Raptor in an array format. The data is a name followed by a number, followed by another number - like this:

Sally
12
30

In the array it shows up like this:

<1>Sally
<2>12
<3>30
... and so on - there are 75 elements in each array.

I need to figure out how to write pseudocode to access the 2nd and 3rd elements so I can multiply them. And I need to be able to do that with the two numbers following the second name, and the third name, etc.

My thought is to write something like

If Hours[Index] == isDigit AND Hours[Index + 1] == isDigit Then
    Set TotalHours = Hours[Index] x Hours[Index + 1]
End If
Index = Index + 1

I hope this makes sense. I'm not confident about using "isDigit" in Raptor. Not sure if it will work is what I mean.

And THANK YOU for your willingness to help.

Emily

So do you know how to do a loop? I just searched on the Internet (because I don't and never use Raptor) and the syntax should be as follows...

For(Index=1, Index<75, Index++)
  Write Hours[Index]
End For

Maybe that's what you need?

Edited: I hate capitalised...

I do know how to write a loop. The Index ++ is not familiar to me. I'll play in Raptor and see if that works.

++ and -- are auto increment/decrement. Yhe following statements are equivalent

index++
++index
index += 1
index = index + 1

If you use ++ in an expression, whether you put ++ before or after is important.

index = 5
x = index++
y = ++index

In the above, x gets the value 5 (x gets the value of index, then index is incremented) and y gets the value 7 (index is incremented, then index is assigned to y).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.