Activity diagram
What is an algorithm?
[br][br]An algorithm is a work plan for solving a problem or task. When coding, an algorithm should be written so precise that a computer can do the task.
Every algorithm should ...
[list=1][*]Consist of simple, clear instructions[/*][*]Is formulated in a suitable language[/*][*]Is made in sequential steps[/*][/list]
The algorithm, described in a language understandable to humans, is then translated into a programming language (for example, JAVA, PHP, or C). An algorithm coded in a programming language is called a source code.
Important algorithms are, for example:
[list][*]Sorting algorithms[/*][*]Search algorithms[/*][*]Paging algorithms (used when data is saved on computers)[/*][/list]
Even in everyday life, there are many algorithms, such as cooking recipes, rules of the road, or other instructions. Below is an example of an everyday algorithm.
Example: Algorithm for powering up the computer
[list=1][*]Press the start button of the computer[/*][*]Start up the computer[/*][*]Choose an account[/*][*]Enter password (login)[/*][/list]
What are activity diagrams?
[size=100]An activity diagram is a model of an activity. Models are an illustration of reality and are used to present facts clearly. In computer science models are used as preparation for all projects. These are like the drawings of an architect before a bridge or house is built.[/size][br][br]
Different display types:
[size=100]To meet different model requirements, there are a large number of different types of diagrams that show a model of different aspekts of a project. The pictures below shows different diagram types. Today we will only take a closer look at the diagram type called activity diagrams.[/size]
Activity diagram:
[size=100]An activity diagram shows the general processes. It indicates a series of activities that lead from a starting point to a finishing point. Here in an example og the game "Ludo". As the example shows, a branching can occur when different situations or outcomes require different responses or actions. For example, there is the possibility that the field you want to go to is occupied. If so, another action will be performed.[/size]
Ludo
Cooking dinner
This is another version of an activity diagram. Here pictures are used to make the process easier to follow.
Other types of diagrams
Here you can see some of the other diagram types. Their focus is not on the actions that need to be taken, but describes other important aspects.
The Entity-Relationship-Diagram
The Use-Case-Diagram
The Flow-Chart-Diagram
Codes in everyday life
The goal of encoding is to process information in such a way that it can be "read" immediately by those who needs it. However, normal language is complex and things like dictionaries, grammar, etc. are needed. This consumes a lot of time and time is money. A commercial can quickly cost thousands of euros on television. Because of this, labels are often used which are quick to understand or decode. You may not be fully aware, but you are constantly decoding signs!
task
Decode the lables
What do the images shown above mean? Decode it!
task
Do you think about symbols (signs) that you decode every day? Write down the examples that come to mind.
Getting to know Ozobots.
Ozobots are small robots that you program with different color codes. Turn it on first. To do this, you press the button that you find just above one of the wheels, until the Ozobot lights up.
task
The Ozobot likes to follow lines. Take the black marker and draw a line on a piece of paper. Place the Ozobot at one end of the line and see what happens.
task
Draw lines with the other colored markers and place the Ozobot on them, one at a time. What do you observe?
task
Draw two different serpentine lines, like shown in the picture below. On which line does the Ozobot travel faster? Explain why.
task
Below is a picture of two different color codes that the Ozobot can decode. Draw the two lines down on a piece of paper and let the Ozobot drive on it. Which line does it drive faster? What do you think the two codes mean?
task
Check if the Ozobot also reacts to other color codes. The best way to do this is to draw lines with color codes at the beginning, as in the picture above, and let the Ozobot drive over them. If you find color codes, make a note of them and describe how they affect the Ozobot.
task
Draw a crossing like showed on the picture down below, and let the Ozobot drive the course several times. Describe what happens.