Register to reply

Writing pseudo-code

by mdnazmulh
Tags: pseudocode, writing
Share this thread:
mdnazmulh
#1
Mar30-08, 12:21 AM
P: 51
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"
Phys.Org News Partner Science news on Phys.org
Sapphire talk enlivens guesswork over iPhone 6
Geneticists offer clues to better rice, tomato crops
UConn makes 3-D copies of antique instrument parts
CRGreathouse
#2
Mar30-08, 12:34 AM
Sci Advisor
HW Helper
P: 3,684
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.
kenewbie
#3
Mar31-08, 03:28 AM
P: 236
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


Register to reply

Related Discussions
Convert latex code to fortran code? Math & Science Software 1
Pseudo force Classical Physics 25
Mg= A Pseudo Force? General Physics 18