Pseudocode and Flowchart

Hello everyone, this is Bndsbon. Today I will be talking about the Flowchart and Rseudocode examples. Need more review on Pseudocode and Flowchart? Please check Intro to Algorithm.

  1. Write pseudo code that reads two numbers and multiplies them together and print out their product.

WechatIMG1.jpeg

 

2. Write pseudo code that tells a user that the number they entered is not a 5 or a 6.

WechatIMG5.jpeg

 

3. 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.

WechatIMG3.jpeg

4.  Write pseudo code to print all multiples of 5 between 1 and 100 (including both 1 and 100).

屏幕快照 2016-11-16 下午8.35.02.png

These are some of the example questions I did during class. And here are some tips I think you need to remember:

*Always remember the spacing, how many space you should have before the “end if”, and before the “if”.

*Never Captialize input or output in a Pseudocode

*Organize your Peseudocode and flowchart (question 3 is a good example, you can have a look at the two flowchart provided).

*Think before you write anything!

You still need more practice? Here are two extra questions that you can check your programming skills:

Write pseudo code that will perform the following.
a) Read in 5 separate numbers.
b) Calculate the average of the five numbers.
c) Find the smallest (minimum) and largest (maximum) of the five entered numbers.
d) Write out the results found from steps b and c with a message describing what they are

Write a pseudocode solution which will take in an integer value and determine whether that value is odd or even.

*If you need the answer to these questions, please leave a message and I will reply very quickly.

All in all, today’s Computer Science Class, can be called as a practice class, where we practice the questions of Pseudocode and flowchart. After this class, I realized the importance of precision in computer programming, a single mistake would cause the whole operation to be a failure. Neverthless, I also discovered the difference between Computer Science and other subjects that I am currently studying, it requires us to have a visualization of the code before we write it down onto a piece of paper. The more I learned about Computer Science, the more interesting I found it is.

Looking forward to our next class!

 

Leave a comment

Blog at WordPress.com.

Up ↑