Q&A for How to Write Pseudocode

Return to Full Article

Search
Add New Question
  • Question
    Is programming always required?
    Community Answer
    Pseudocode isn't real code, but details what a program should do step by step. Knowing how to write code is necessary to writing meaningful and useful pseudocode.
  • Question
    How can I tell the difference between an odd and even number using pseudocode?
    Community Answer
    Divide it by two to see if you get a remainder. If not, then it's even; if yes, then it's odd.
  • Question
    How do I spot errors in pseudocode?
    Scratchless
    Community Answer
    Since pseudocode isn't real code, there can't be any errors. You decide what you want to write as pseudocode and then translate it to any coding language you'd like.
  • Question
    Where can I write pseudocode?
    Community Answer
    When you start jotting it down it can be anything from a notepad to a napkin or a dedicated writing application like Word or Google Docs. Once you start detailing your pseudocode I recommend switching over to a plain text/raw text (.txt) application such as Notepad, TextEdit, WordPad, and then begin translating it to actual code gradually. It's very important to remember that a computer CANNOT execute code written in a formatted document file, such as .doc or .docx, pdf. They can only interpret .txt plain text, made into something like a .jar, .class, etc (developer file formats). You cannot run code with just raw text. Remember to make it a dev file first.
  • Question
    Is pseudocode necessary for programming?
    Community Answer
    It isn't exactly necessary, but knowing pseudocode helps in learning how to program faster.
  • Question
    How do I write pseudocode?
    Community Answer
    Follow the steps here to learn!
  • Question
    Can I use words such as "count" to sum up data in writing a pseudocode?
    Community Answer
    You can do whatever you like in pseudocode! Just as long as you know how to convert it to actual code, anything goes.
  • Question
    Is verbal the right word?
    Community Answer
    Verbal works in this context: as in "relating to or in the form of words." In your head, as you read the article, try replacing "verbal" with "written out in words."
  • Question
    Can I use dedicated/made-up functions (i.e. PLAYSOUND, MAKE, READ, WRITE, etc.)?
    Scratchless
    Community Answer
    Of course. You decide what you write in pseudocode. It won't come up with any errors and as long as you know how to code it into a programming language you should be fine.
  • Question
    How do I write pseudocode for a switch case structure?
    Community Answer
    Because switch statements are essentially nested if-else statements, you can use if statements. For example, you could use if for each case and else for the default.
  • Question
    Is pseudocode and algorithm the same, or different?
    Graham Trott
    Community Answer
    Different. An algorithm is a set of steps to perform a given function; pseudocode is just one way of describing those steps. The steps can be expressed in a conventional programming language or in pseudocode. The former will actually run; the latter will not until translated into computer code. Unless, that is, someone writes a compiler to handle your pseudocode. That's not as silly as it may sound; languages like Apple's HyperTalk closely resemble pseudocode.
  • Question
    How to pseudocode for functions? Do we simply write 'call for function()'?
    Community Answer
    A function in real code is like "when FUNCTION_NAME is runned, do:". You can use "when FUNCTION_NAME is runned, do:" for a function Pseudocode start.
  • Question
    What are global variables?
    Community Answer
    Variables that can be used throughout the entire program. A local variable can only be used in the part that created the local variable.
  • Question
    Write a pseudocode to input the temperature in Fahrenheit and convert it into Celsius?
    Simeon Watson
    Community Answer
    fahrenheit = input "Temperature in degrees Fahrenheit: " write {fahrenheit} degrees Fahrenheit equals {(fahrenheit-32)/1.8} degrees Celsius.
  • Question
    How do I write a pseudo code for an algorithm that reads grocery lists and prints out the products needed in alphabetical order?
    Simeon Watson
    Community Answer
    You would do that as follows: Access camera. Write "point camera to grocery list" if camera registered type = "text": list = camera read top-to-bottom list sort alphabetically write list
  • Question
    Write a Pseudocode that will accepts two integers and calculate the sum, product and average of the two inputted integers. Display the results.
    Simeon Watson
    Community Answer
    That would be written as: integer1 = integer(input(Integer 1: )) integer2 = integer(input(Integer 2: )) sum = integer1 + integer 2 product = integer1 * integer2 average = (integer1 + integer2)/2 write { Sum = [sum] Product = [product] Average = [average] }
Ask a Question

      Return to Full Article