Is Relational Operator Usage in Pseudo-Code Valid?

  • Thread starter Thread starter mdnazmulh
  • Start date Start date
  • Tags Tags
    Writing
AI Thread Summary
The discussion centers on the validity of using relational operators in pseudo-code, specifically in the context of translating C++ statements into a simplified format. It is confirmed that using relational operators like < and > in pseudo-code is acceptable, as pseudo-code is inherently flexible and does not adhere to strict rules. However, there is a critique regarding the level of detail in the provided example, suggesting that such specificity may undermine the purpose of pseudo-code, which is to provide a high-level overview rather than detailed instructions. The conversation highlights the balance between clarity and simplicity in writing effective pseudo-code.
mdnazmulh
Messages
51
Reaction score
0
I have just started computer programming in this running semester. So, I'm not experienced in writing pseudo-code. I have one thing to ask. Look at the following c++ statements:

if (x>10)
cout<<"x is greater than 10"<<endl;

Can I replace these c++ statements by the following pseudo-code?

If x>10 (Look, i used relational operator in pseudo-code. Is it valid?)
print "x is greater than 10"
 
Technology news on Phys.org
Sure, it's fine. Pseudocode doesn't have any hard-and-fast rules by its nature, but using < and > along with other basic operators like + is just fine.
 
I imagine your example is very theoretical is is just used to illustrate the idea of pseudo code for a class or something?

Because nobody in their right mind would write pseudo code that detailed, it is 6 chars short of the real code! Imagine writing a code outline for a chess game with that much detail. You might as well just write the game itself.

k
 
Thread 'Star maps using Blender'
Blender just recently dropped a new version, 4.5(with 5.0 on the horizon), and within it was a new feature for which I immediately thought of a use for. The new feature was a .csv importer for Geometry nodes. Geometry nodes are a method of modelling that uses a node tree to create 3D models which offers more flexibility than straight modeling does. The .csv importer node allows you to bring in a .csv file and use the data in it to control aspects of your model. So for example, if you...
Back
Top