Understanding Algorithms, Pseudocode, and Flowcharts in Programming

Slide Note
Embed
Share

Learn the fundamental concepts of algorithms, pseudocode, and flowcharts in programming through a series of detailed explanations and visual representations provided by Dr. Nouf Aljaffan. Explore the stages in program development, creating algorithms, computational thinking principles, and the practical applications of pseudocode and flowcharts in designing solutions. Dive into essential programming concepts such as planning solutions, input/output operations, iteration, branching, and sequence execution. Enhance your understanding of algorithm design, problem-solving techniques, and the role of decomposition, pattern recognition, and abstraction in computational thinking.


Uploaded on Sep 29, 2024 | 1 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. Algorithms & Pseudocode & Flowcharts Dr. Nouf Aljaffan naljaffan@ksu.edu.sa

  2. Objectives Learn how to write an algorithm using Flowchart and Pseudocode Nouf Aljaffan (C) 2018

  3. 1- Analysis of a problem Stages in Program Development Process 2- Create the algorithm 3- Compile the program 4- Execute the program 5- Testing and Debugging the Program Nouf Aljaffan (C) 2018

  4. (2) Create the algorithm Plan for solution and use basic statements and expression to develop the algorithm Nouf Aljaffan (C) 2018

  5. Computational Thinking https://youtu.be/mUXo-S7gzds Nouf Aljaffan (C) 2018

  6. Computational Thinking Decomposition Breaking down data, processes, or problems into smaller, manageable parts Pattern Recognition Observing patterns, trends, and regularities in data Abstraction Identifying the general principles that generate these patterns Algorithm Design Developing the step by step instructions for solving this and similar problems Nouf Aljaffan (C) 2018

  7. Write Output Read Input Store data Calculate Compare and branch Iterate or Loop Sequence What Can a Program Do? Nouf Aljaffan (C) 2018

  8. Sequence Iterate or Loop Compare and branch Entry Test false true condition p false statement a true statement a Exit No Nouf Aljaffan (C) 2018

  9. Planning the Solution Pseudocode is a semi-programming language used to describe the steps in an algorithm. Flowchart is a graphical representation of an algorithm. Nouf Aljaffan (C) 2018

  10. Planning the Solution 1) Flowchart 2) Pseudocode Start/End Begin/End (not necessary) Input/Output Read/Print : read x,y Process [An equation] : x=y+6 Comput: compute x as y+6 If/ if-else / While Decision Predefined process [function_name()]: average(x,y) Line Not Applicable Connector Not Applicable Nouf Aljaffan (C) 2018

  11. Example 1 Sequence Nouf Aljaffan (C) 2018

  12. Example 2 Compare and branch Flowchart Pseudocode Nouf Aljaffan (C) 2018

  13. Example 3 Iterate or Loop Flowchart Pseudocode start End Nouf Aljaffan (C) 2018

  14. Example 4 Calling predefined processor Nouf Aljaffan (C) 2018

  15. Exercise 1 Write an algorithm to find the perimeter of triangle Nouf Aljaffan (C) 2018

  16. 1 2 Write an algorithm to find greatest of given three numbers Write an algorithm to check whether given integer value is PRIME or NOT. Exercise 2 Nouf Aljaffan (C) 2018

  17. Exercise 3 ABC company plans to give a 6% year-end bonus to each of its employees earning Rs 6,000 or more per month , and a fixed Rs 250 bonus to the remaining employees. Write an algorithm to calculate the bonus for an employee Nouf Aljaffan (C) 2018

  18. Conclusion The flowchart and the pseudocode were explained There are many styles of pseudocode. Flowchart could be time-consuming but a good tool in education. Nouf Aljaffan (C) 2018

  19. Question! Nouf Aljaffan (C) 2018

  20. References https://computationalthinkingcourse.withgoogle.com/unit Nouf Aljaffan (C) 2018

Related


More Related Content