Week 5 Computer Systems Lecture: Flowchart and Pseudocode 13.02.23
Video
First part of flowchart is to input a number
Then a second number
Then the flowchart will ask a question
The flowchart will then branch the output
Make sure you know what shapes should be used in the flowchart
Pseudocode is an alternative way to represent the sequence in an algorithm
The instructions match up to the flow chart e.g. INPUT number 1
Flowcharts
Diagram that represents workflow or process
Can also be defined as a diagrammatic representation of an algorithm, a step-by-step
approach to solving a task
X = Price, Y = Price 2
If the price of product 1 is bigger than the price of product 2, print X. Otherwise print Y, then
stop
If X and Y are the same price, you will get an error. You have to do another branch e.g. if X
=Y, you need to print X and Y are the same
You can also write if X=Y or if X>Y and this can go to one branch
The flowchart shows the steps as boxes of various kinds, they are ordered by connecting the
boxes with arrows
This diagrammatic representation illustrates a solution model to a given problem
Flowcharts are used in analysing, designing, documenting or managing a process or program
in various fields
Example of customer credit
Need to add Start and Finish
Buy product - Credit form Order form Credit check If the credit check is good
Review accounts receivable balance. If credit check is not good back to sales call
You can only have two arrows from every statement e.g. yes/no, true/false, 1/2
If you need more than two arrows, you need to add another statement
Flowchart (Loop statement While/do while)
Between the input and output there is a processing stage
While – you have a condition (true or false) e.g. while I = < 5 and you want to change. Check
the task, then check
Do while – I < 5, check the file, then do the task
For – you need 3 things: initial value, last value and increment or decrement value
Loop – the arrow loops back to the start. Do while – the loop stems from the condition,
While loop – the arrow stems from the task
Over 60 working example Python
And is the same as multiplying e.g. 0 and 1 is 1
If the condition is false you will not get anything in the output
0 or 1 is 1
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller cpaine. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for £7.49. You're not tied to anything after your purchase.