Pseudocode is an informal high-level description of the operating principle of a computer program or other algorithm. It uses the structural conventions of a normal programming language, but is intended for human reading rather than machine reading. Pseudocode is a simple way of writing programming code in English. Pseudocode is not actual programming language. It uses short phrases to write code for programs before you actually create it in a specific language.
Once you know what the program is about and how it will function, then you can use pseudocode to create statements to achieve the required results for your program.
There are two different versions of the IB Pseudocode guide:. Common Action Keywords . Input the next grade Add the grade into the total Set the class average to the total divided by ten. Review the python code below and then re-type it in pseudocode. There is a suggested answer to this below.Concepts of Algorithm, Flow Chart & C Programming
It is also a clear and concise way to represent an algorithm. Data items to be processed by the algorithm are given meaningful names in the same way that variables and constants are in a high-level programming language. Pseudocode is not bound by the strict syntax rules of a programming language. Variables, constants and data types in Pseudocode rules to follow. The expression on the right can be a single value or several values combined with mathematical operators.
When different actions are performed by an algorithm according to the values of the variables, conditional statements can be used to decide which action should be taken. The algorithm above checks if a mark is valid and a pass or a fail. This makes use of two IF statements. This is called nested IF. You are commenting using your WordPress. You are commenting using your Google account. You are commenting using your Twitter account. You are commenting using your Facebook account.
Notify me of new comments via email. Notify me of new posts via email. Skip to content Posted on August 31, April 25, by michellescomputerscience. It does what its name says; it pretends to be programming code! Variables, constants and data types in Pseudocode rules to follow Atomic types names: Integer: a whole number Real: a number capable o containing a fractional part Char: a single character String: a sequence of zero or more characters Boolean: the logical values TRUE and FALSE Literals Literals of the above data types are written as follows: Integers: written as normal in the denary system, e.
A string may contain no characters i. Share this: Tweet Email. Like this: Like Loading Leave a Reply Cancel reply Enter your comment here Fill in your details below or click an icon to log in:. Email required Address never made public.Pseudocode is a useful early step in designing and planning computer programs. The idea is that it is easier and more natural to think in terms of an algorithm the steps to achieve a solution rather than in terms of actual computer code.
Writing code after writing pseudocode should be a simple translation process — converting the algorithm to a program in a specific language. The exact implementation will depend on the language, which is why pseudocode should be "language agnostic". There are no rules to produce "perfect" pseudocode, since it doesn't have to compile, but this document provides guidelines for writing good pseudocode. Pseudocode must solve the problem at hand using well-defined operations. The programmer who translates pseudocode should be able to do so almost mechanically.
There should be no need to develop algorithms or solve problems at the programming stage. Software development is a multi-stage process, and most of the hard work should take place during design, rather than construction. There's an analogy here to writing, say, an essay. The hard part is coming up with your ideas and arguments; getting the grammar and spelling right should be the easy part.
In software development, the design of algorithms is the hard part, and the translation to a programming language implementation should be easy. Pseudocode should not be specific to a particular programming language; it should use general concepts and conventions. Why is "import random module" bad? Not every language has a random module, and even if they all did, importing that module is not an essential part of the algorithm.
You're not telling the programmer how to write a program, you're telling her how to solve a problem. You can assume that the programmer who implements your pseudocode has enough intelligence and knowledge to use the tools available in her programming language.
Pseudocode needs to be well-indented, well-spaced and be consistent in style, so that it doesn't confuse or annoy the programmer who reads it.
Variable names must be consistent and clear, and be used explicitly. Note: variable names don't have to be in camel-case e.
This is part of being language independent — there is no fixed or language-related convention. Having said that, you may find it convenient to use the convention for the language you expect to implement in since you can copy and paste into code more easily.
Pseudocode should be concise. Write instructions as simply as you can without sacrificing clarity. Note that the "good" example looks a lot like code, and that's OK. You don't have to go out of your way to make pseudocode look unlike code.
Just be simple, conventional and clear. Pseudocode should solve the problem, but that's it! There should be no superfluous material. It's OK to have comments in pseudocode, but the instructions themselves should not speak about the intention. Such a statement adds no information.
Statements like the above often occur when software developers work backwards from the code when writing their pseudocode. Pseudocode should be organised into appropriate functions, as is the case for code. There should be a one-to-one mapping between functions in pseudocode and functions in code. The pseudocode within functions should have the five quality attributes already discussed. Each individual function should be specified separately; the pseudocode for a function should not be written where it is called.Are you a home educating parent?
Then this guide is for you. My contact details are at the bottom. I is for International. They are available to anyone who wants to sit them, and are often taken by home educated children because there is no coursework involved — just exams.
Coursework is very hard to get assessed if you are home educated. I will not be offering this course because it has a practical exam on a computer and it will be very difficult for parents to find an exam centre that will offer this. The exam code for the A-E grading is This is available in the UK and the rest of the world. The syllabus is here on the CIE website. But briefly, it covers:. There is no minimum age for taking it and anyone can take it as many times as they like.
Computer programming is a large part of the preparation for this exam — especially the second exam.
The Pre-release programming task is sent out to students about 3 months before the exam date. Without good practice and knowledge of programming, it would be impossible to pass the second exam. This short video explains all about the pre-release: here. They are testing your general programming knowledge and ability to problem solve. Most home educated children sit their exams at a variety of places around the country: private schools, colleges and dedicated exam centres.
CIE exams are a little harder to find an exam centre for, but not impossible. There are three different course books available and accredited by CIE. There are also revision guides too. Here are links to the official books: note — I only use the Python book with my students and use alternative course books. Official Cambridge Coursebook. Official Programming Course Book Python.
IGCSE Computer Science : A Guide For Parents
Official Revision Guide. That depends on your child and their academic ability, but if your child has little computer or programming experience, they need to set aside extra time to practice and study especially when they first start. BBC Bitesize is also helpful and covers a good chunk of the syllabus. Just that this a great exam to take if your child is interested in computing or programming.
It covers almost all the basics except networks! Save Save. The exam code for the grading is This is only available in the UK. What is in the syllabus? There are two written exams both 1hr 45mins long.Need guidance? If yes, then you have landed at the right place.
Our website has a wealth of resources, which are really helpful in preparation for Cambridge Examinations. We will be honored to serve you!
Results can be issued to candidates immediately. Our website is verified and trustful. Every file before being uploaded is thoroughly checked for authenticity. Regardless of whatever happens, we don't let our servers go down.
All the errors are sorted out at the earliest priority. For help or any suggestion, just message us at our social media profiles. Moreover, if there is something you want to be included on the website, message us at our facebook page, we will proceed your request as quickly as it will be possible. We keep our tradition of uploading the latest past papers for Cambridge exams series, right after the exam results are announced.
We have the largest collection of free e-books for Cambridge subjects. No surveys, no ads! Our content is protected by DMCA, so no-one is authorized to publish it under their names. If past papers for any subject are missing, please inform us by posting a comment at Past Papers Section. Welcome to GCE Guide! Latest Updates: ebooks and CD-resources sections are facing a downtime due to varied reasons.
They will back up once everything has been sorted out. Cambridge O Levels Sociology Notes have been added. If any resource is missing, inform us using the Contact Us!
Ch 10. Pseudocode and flowcharts
Latest Blog Posts.Pseudocode is a non-language-specific way of writing code. It is used during the design phase of a project as a quick way of devising algorithms before the language to be used is known and without needing to spend too much time using the exact syntax correct. Once pseudocode algorithms have been written it should then be easier to use this to help write the program code.
Pseudocode is a structured way of writing algorithms which looks very much like program code. Since pseudocode is an informal way of writing code there are different ways of writing it even at GCSE level. You should be aware both of what pseudo you are expected to be able to read and how you should write code for your course.
Also you should be aware of whether or not a pseudocode fact sheet is provided. When devising an algorithm the programmer will need to use variables and assign values to them. Many languages require a variable to be defined and given a data type before use. The arrow points from the value being assigned towards the variable it is being assigned to. Understand and use pseudocode, using the following commands and statements: - totalling e. The assignment operator can also be used when finding totals, as shown in the following example where x becomes equal to a plus b.
Similarly we can also use the assignment operator for counting, by assigning a variable to become equal to the value of itself plus 1. Output is the act or returning some data to the user of the program. This could be in the form of a written message, a numerical value, an image, video or sound. The example below shows how we would output the message 'Hello World':.
Input on the other hand is when we expect some value to be provided by the user. The following example will output a message asking the user to input their name and assign it to a variable called 'name'. The use of selection allows decisions to be made within an algorithm at run-time based on certain conditions. An IF statement starts with a condition which is tested. If the condition evaluates as false then the ELSE block will run.
This structure is used when there are many possible outcomes to a condition. If x is equal to anything else then we print "Goodbye". Iteration is used when we need to repeat a block of code. We can make a code block repeat either for a given number of repetitions or continuously either for as long as a condition continues to be true or until a condition becomes true. The FOR loop is used to repeat code for a given number of repetitions.
We specify a counter variable and set it to an initial value and then specify an end value. After every iteration of the loop the counter variable is automatically incremented by 1. In the following example x starts at 1 and increases by 1 every time the code repeats until it reaches a value of 10, then the loop will terminate.
The condition is not checked until after the code has run once, so regardless of whether the condition is true or not the code will always run at least once. The following example will continue to take user input until the user inputs a value less than Pseudocode is an informal program description that does not contain code syntax or underlying technology considerations.
Pseudocode allows you to write easy to read but precise instructions for a program or algorithm. There are many ways to write pseudocode, to reduce uncertainty we will use the following conventions in CSE and CSE The general form is:.
The ELSE keyword and "statement block 2" are optional. If the condition is true, statement block 1 is performed, otherwise statement block 2 is performed. The BREAK is important because once a "match" has been found, it will continue executing the remaining conditions. That is, in the example above, if condition 1 is true, without including breaks, it will execute condition 2, condition 3 and so on.
Conditions are normally numbers or characters indicating the value of "expression", but they can be English statements or some other notation that specifies the condition under which the given statement block is to be performed. A certain statement block may be associated with more than one condition. Important Notes: Any instructions that occur inside an iteration must be indented. The statement must show appropriate closing word.
Pseudocode CSE 1321 Guide
The loop is entered only if the condition is true. The "statement block" is performed for each iteration. At the conclusion of each iteration, the condition is evaluated and the loop continues as long as the condition is true. The "statement block" in this type of loop is always performed at least once, because the test is performed after the statement block is executed. At the conclusion of each iteration, the condition is evaluated, and the loop repeats if the condition is false.
The loop terminates when the condition becomes true. FOR Statement This loop is a specialized construct for iterating a specific number of times, often called a "counting" loop. You can also change the amount that you increment the counter by each time the loop executes:. Sometimes, we have a data structure that holds zero or more elements inside of it. For example, you may have a list of employees inside a data structure called "employeeList" and want to print out each person's name.