How to write Pseudo-code? My question is really how much detail there should be in the algorithm. I mean, do I include the formulas, too? Here is a sample pseudo-code I wrote for a program that asks if a number is even or odd. Display "Enter number: " Get input = number Divide number by 2 If remainder is equal to 0 then display that number is even. If remainder is greater than 0 the display that number is odd.
I'm not even sure if there is an "official" way to do pseudocode, but this is the way they do it in my Numerical methods textbook. Output("Enter number") Input(number) remainder = number mod 2 if remainder = 1 then { Output ("Your number is odd") } else { Output ("Your number is even") }
Psudo = Fake/Simulated Code = Computer programming So it is a fake or simulated program. Like Mandre's cat says, it is not some official thing with one way to do it.
Join our real-time social learning platform and learn together with your friends!