--> Skip to main content

Total Pageviews

CT Week1

Computational Thinking and Flowcharts

πŸ“š

Summary

Computational Thinking

Computational thinking is a problem-solving process that includes a number of characteristics and dispositions, such as:

  • Decomposition: Breaking down a complex problem or system into smaller, more manageable parts.
  • Pattern Recognition: Looking for similarities among and within problems.
  • Abstraction: Focusing on the important information only, ignoring irrelevant detail.
  • Algorithms: Developing a step-by-step solution to the problem, or the rules to follow to solve the problem.

Flowcharts

A flowchart is a type of diagram that represents a workflow or process. Flowcharts are used in analyzing, designing, documenting, or managing a process or program in various fields.

Flowchart Symbols

Terminal
Input/Output
Processing
Decision

(note the symbol for decision is diamond, the code is not showing properly)

Flowcharts use specific symbols to represent different types of actions or steps in a process:

  • Terminal: Indicates the start or end of a process.
  • Input/Output: Represents an input or output operation.
  • Processing: Denotes a process to be carried out.
  • Decision: Shows a decision point in the process.
  • Connector: Connects different parts of the flowchart.

Advantages of Flowcharts

  • Helps to clarify complex processes.
  • Improves communication among team members.
  • Assists in identifying bottlenecks and inefficiencies.
  • Provides a visual representation of the process.

Example Flowchart

Here's an example of a simple flowchart for a decision-making process:

Start
Input Data
Is Data Valid?
Process Data
End

Data Types

Data types are classifications of data that tell the compiler or interpreter how the programmer intends to use the data. Common data types include:

  • Character: A single character, such as 'a', '1', or '$'.
  • Integer: Whole numbers, such as 1, 42, or -7.
  • Boolean: Represents true or false values.

Sanity of Data

Sanity of data refers to the correctness and validity of data. It ensures that the data is accurate, consistent, and reliable.

Records and Lists

A record is a collection of related data items, typically of different data types, grouped together. A list is an ordered collection of items, usually of the same data type.

Example of a Record:

        {
            "name": "John Doe",
            "age": 30,
            "isStudent": false
        }
    

Example of a List:

        [1, 2, 3, 4, 5]
    

The main difference between a record and a list is that a record can contain different data types, while a list typically contains items of the same data type.

Graded Solution

Graded assignment solutions are available online. I’m sharing them here, but please make sure to solve the problems yourself first. Copying directly will only be a disadvantage to you.

Embedded PDFs

PA

PA

GA

Comments

Post a Comment