you have to create a parse tree of the float chart, then you can do a depth first search to get the contents of the parse tree and create your pseudo code. if you are not familiar with the depth first algorithm, this is how it works, you have to get the left most node then go back to its parent, in a flowchart only the condition will have left and right node. this has been done by my classmate during college and help them formulate an algorithm that will translate a flowchart to c or c++.

Hi. I suggest you start going through the program, one bubble at a time. For example, concentrate on the first bubble. It says "Reading [data.txt]". Ask yourself these questions:

What does that mean?
It means that the program should read the contents of data.txt.

What is the goal of this bubble?
Well, I think the goal must be to open and read the contents of data.txt and put them in some data structure in memory.

What steps are required to achieve this goal?
I need to:

  • Open the file for reading
  • Loop through all entries, reading one at a time
  • Convert every entry to fit my data type
  • Insert every entry in my data structure
  • Close the file (If not done later in flowchart)

From here, you pretty much got it. Just translate every step to pseudo code. Then pick next bubble.

I hope this helps!

Regards,
Emil Olofsson

you have to create a parse tree of the float chart, then you can do a depth first search to get the contents of the parse tree and create your pseudo code. if you are not familiar with the depth first algorithm, this is how it works, you have to get the left most node then go back to its parent, in a flowchart only the condition will have left and right node. this has been done by my classmate during college and help them formulate an algorithm that will translate a flowchart to c or c++.

Dafuq did I just read? Incognitus, I suspect the OP is asking how to write pseudocode corresponding to a flow chart manually, not how to devise an algorithm that does it programmatically.

This article has been dead for over six months. Start a new discussion instead.