Converting flowchart to pseudocode

  • Thread starter Thread starter sandy.bridge
  • Start date Start date
Click For Summary

Discussion Overview

The discussion centers around the conversion of flowcharts to pseudocode, particularly in the context of a homework assignment. Participants explore the implications of specific rules governing flowchart design and their potential limitations when translating to pseudocode. The conversation includes theoretical considerations, challenges faced in the conversion process, and the nature of pseudocode itself.

Discussion Character

  • Debate/contested
  • Conceptual clarification
  • Technical explanation

Main Points Raised

  • One participant expresses confusion over the professor's claim that a flowchart can exist that cannot be converted into pseudocode, despite the belief that all pseudocode can be represented by flowcharts.
  • Another participant suggests that the issue may relate to the halting problem or side effects of atomic operations, which could complicate the conversion process.
  • Some participants propose that pseudocode with more than two branches from a decision point would be difficult to represent in flowchart form, highlighting a potential limitation in the flowchart rules.
  • There is a discussion about the absence of certain control structures in the pseudocode language, such as GOTO statements or recursion, which could affect the conversion process.
  • One participant notes that the flowchart rules do not specify limits on the number of START elements, which could lead to ambiguity in the conversion process.
  • Participants discuss the implications of loops and self-referential structures in pseudocode, questioning how these would be represented in flowcharts.
  • There is mention of flowchart tools that generate flowcharts from pseudocode, raising questions about the professor's assertions regarding their equivalence.

Areas of Agreement / Disagreement

Participants generally express uncertainty and disagreement regarding the professor's claims. Multiple competing views are presented about the feasibility of converting flowcharts to pseudocode under the given rules, and the discussion remains unresolved.

Contextual Notes

Participants note that the rules for pseudocode and flowcharts have not been fully clarified, leading to confusion about what can or cannot be represented. There are also concerns about the lack of detail regarding the pseudocode language itself, which complicates the discussion.

  • #61
Don't leave it empty put in your best guess, you may be right (maybe the prof is searching for the answer to the conundrum himself and waiting for that one special chosen student)

You can't win if you don't play.
 
Physics news on Phys.org
  • #62
sandy.bridge said:
Since pseudo-code is supposed to evaluate each of its actions one at a time, what if we did the following? There is nothing in the flow chart that indicates which of the atomic actions it is supposed to evaluate first, and hence we would not be able to represent it in pseudo-code unless it was actually specified.

I thought "bullets" could only have one arrow out?
 
  • #63
Yeah, you're right.
 
  • #64
In case you're interested, the solution was merely two flows meeting up at a bullet, and then going into an atomic action.
 
  • #65
sandy.bridge said:
In case you're interested, the solution was merely two flows meeting up at a bullet, and then going into an atomic action.

:confused: But with only one START allowed, where does the second flow come from? That's what we were trying so hard to gimmick up with the phantom threads created by the dangling decision blocks... Hmph.
 
  • #66
sandy.bridge said:
In case you're interested, the solution was merely two flows meeting up at a bullet, and then going into an atomic action.
Two flows or two paths, of which only one can be taken at a time? If it's two paths, then this is the same as pseudocode containing two or more branches to the same label.
 
Last edited:
  • #67
sandy.bridge said:
In case you're interested, the solution was merely two flows meeting up at a bullet, and then going into an atomic action.

Professorial fail. That's easy to represent in pseudocode and a common requirement.

I don't suppose you have a diagram of this so-called impossible flowchart.
 
  • #68
Here:
 

Attachments

  • q5_soln2.png
    q5_soln2.png
    4.8 KB · Views: 757
  • #69
But that's trivially implemented in any pseudo code that isn't deliberately hobbled by fanatical style rules.
 
  • #70
FirstTest: If not wantBanana then goto SecondTest
selectFruitFromBunch
Enjoy: peelAndEatFruit
goto FirstTest
SecondTest: if wantOrange then goto Enjoy
Stop
 

Similar threads

Replies
9
Views
9K
  • · Replies 20 ·
Replies
20
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 15 ·
Replies
15
Views
3K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 7 ·
Replies
7
Views
5K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
22
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K