Not sure how to start a Pseudo for an Array

  • Thread starter Aoxx
  • Start date
  • Tags
    Array
In summary, if you are using an array, you will need to set aside a large enough array to hold all the expected data sets. You can then read in marks one by one until a negative number is reached to indicate the end of data. This process can be used to create a count and average for a test given to a class, even if the total count of tests is not known.
  • #1
Aoxx
1
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
  • #2
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

...
...
...
 

FAQ: Not sure how to start a Pseudo for an Array

What is a Pseudo for an Array?

A Pseudo for an Array is a way to represent an array in a step-by-step, algorithmic format. It is a set of instructions that can be followed to create an array, manipulate its elements, or perform other operations on it.

Why is it important to have a Pseudo for an Array?

A Pseudo for an Array helps to break down complex array operations into smaller, more manageable steps. It also serves as a guide for writing code and helps to ensure that all necessary operations are included.

How do I start writing a Pseudo for an Array?

The first step in writing a Pseudo for an Array is to clearly define the problem or task you want to solve with the array. Then, break down the steps required to achieve the desired outcome. Use clear and concise language to describe each step, and make sure to include any necessary variables or data structures.

Can a Pseudo for an Array be used for any type of array?

Yes, a Pseudo for an Array can be used for any type of array, including one-dimensional, multi-dimensional, and associative arrays. The steps may vary slightly depending on the type of array, but the general format remains the same.

How do I know if my Pseudo for an Array is correct?

One way to check the accuracy of your Pseudo for an Array is to manually follow the steps and see if they produce the desired outcome. Another way is to translate the Pseudo into code and test it with different inputs to see if it works as expected. It's also a good idea to have someone else review your Pseudo to catch any errors or suggest improvements.

Similar threads

Replies
3
Views
1K
Replies
21
Views
2K
Replies
5
Views
2K
Replies
1
Views
1K
Replies
2
Views
1K
Replies
4
Views
4K
Replies
15
Views
2K
Back
Top