Not sure how to start a Pseudo for an Array

  • Thread starter Thread starter Aoxx
  • Start date Start date
  • Tags Tags
    Array
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 2K views
Aoxx
Messages
1
Reaction score
0
I am VERY new to this, i am trying to start a pseudo code write where i need to make an array. I have my flowchart done (at least i think i do ) but i am not sure how to actually start the code. The examples my teacher had are confusing and he is not answering my emails. I have to write pseudo for a count and averager for a test given to a class but the total count of tests done is not known. My issue to start is how i *actually* make the array list/space in pseudo. Any advise would be helpful and or examples of a start code with the array sections pointed out. Thank you.
 
Physics news on Phys.org
If you are using an array, then in most languages you will have to set aside a sufficiently-large array that it will be able to accommodate all expected data sets.

Code:
mark: array 1..200 of real numbers;

Then you'll read in marks one after another, until something indicates end of data
Most languages have a character or key that serves this function, but you might choose to say that a negative number will be used to indicate end of data

Code:
begin

loop through this block
  read a number
  if number >=0 store it as a mark
     else end this loop and go to the next stage

...
...
...