Expressions of Algorithm
- Natural language
- Flow Chart – formalized graphic representation
- Pseudocode – generic artificial language
- Programming Language – artificial language to communicate with computer system
When we are programming, we actually go through this translation process in mind or by writing down: natural language→ pseudocode→ apply syntax in the programming language.
Pseudocode & Flow Chart
Exercise
Write pseudo code that reads two numbers and multiplies them together and print out their product.
Write pseudo code that tells a user that the number they entered is not a 5 or a 6.
Write pseudo code that performs the following: Ask a user to enter a number. If the number is between 0 and 10, write the word blue. If the number is between 10 and 20, write the word red. If the number is between 20 and 30, write the word green. If it is any other number, write that it is not a correct color option.
Write pseudo code to print all multiples of 5 between 1 and 100 (including both 1 and 100). If A mod 5=0
Write pseudo code that will count all the even numbers up to a user defined stopping point.
(Answers Pictures in Exercise were made by the author herself.)
Personal Reflection: In this class, I learned how to write Pseudo code and draw flow chart. There are many rules, for instance, we should use different shapes to represent different type of commands in flowchart, “input” in Pseudo code should always be written in small letter.
Works Cited
Cisneros, Pablo G. “The 10 Algorithms Every Computer Science Student Must Implement”. Linkedin. N.p., 2016. Web. 17 Nov. 2015.