Embedded Electronics. Exercise: Structure charts

Embedded Electronics. Exercise: Structure charts JSP-chart ( Jackson Structured Programming ) is a simple two-dimensional graph that may be used to d...
Author: Marcus Joseph
0 downloads 2 Views 151KB Size
Embedded Electronics. Exercise: Structure charts

JSP-chart ( Jackson Structured Programming ) is a simple two-dimensional graph that may be used to document computer programs. The diagram symbols thar are used are sequence, selection and iteration, which are the basic operations that make up all computer programs. ( Another chart - flow chart - can almost be considered as one-dimensional ).

In the horizontal direction the time dimension is shown, ie the order in which things are done. The vertical direction display resolution, for each level down the level of detail increases in the description.

1 Sequence, selection and iteration – structure chart Draw the structure chart to the information below. The diagram should describe the component of the task that is written in italics. 1.1 Onet year can be divided into the four seasons. 1.2 When you call someone, usually several signals pass before they can answer. 1.3 When Sven shall go to school, he can choose between two different communication means. He can either go by car with his father or travel by bus. 1.4 A chain consists of a number of links. 1

2 Sequence, selection and iteration – structure chart 2.1 Which of the components in the structure chart at right are: 1. 2. 3. 4. 5. 6.

Sequences Sequence parts Iterations Iteration parts Selections Selection parts Structure chart

2.2 When calling on phone, it can happen that you get to hear one of these signals: 1. Busy signal: - - - - - - - - - - - - (short notes with short spacing) 2. Blocking tone : - - - - - - - - - - - - (short tones, every other weak and every other strong) 3. Redirection tone: - - - – - - - – - - - – ( three short and one long tone) Draw structure chart of the three signals 2.3 Structure chart below shows the different possibilities to combine a train set

Trainset structure chart

2

Which of the following train sets applies to the structure above?

Different train sets

2.4 The structure chart at right contains some inaccuracies. Draw the structure chart, so that it meets the JSP rules.

2.5 Draw a structural diagram of an arbitrary name, which consists of one or more names. The first names can be either boys or maiden name. 2.6 Draw a structural chart showing Olle's Monday schedule in school. The day begins with a twohour Swedish, followed by two hours of mathematics and then lunch break. Every other week begins the afternoon with two hours of computer skills and on every other week two hour sports. The school day ends with one hour English followed by one hour history. 2.7 Draw a structural chart of a panel debate with three commentators D1, D2 and D3. The debate begins with the three debaters opening statement, first D1, D2, and then finally D3. Then follows a series of speech from the three. The debate ends with the debaters closing statements in the reverse order of the keynote speeches.

3

3 Sequence, selection and iteration, structure chart 3.1 Pull-up – structure chart 1. Use structure chart to show how it is to do 20 push-ups. Consider what is the sequence and iteration. 2. Insert that you can choose if you want to make them the "hands and feet" or "on hands and knees." Now, also selection is in the context. 3. Now you should first make 10 pull-ups of "hands and feet" and then you can choose if you want to make the last 10 at the "hands and feet" or "on hands and knees."

3.2 Cake – structure chart 1. Ange Use structure chart to show how it is to eat a piece of cake. Consider what is sequence, iteration and selection. 2. You can take several pieces of cake while you're hungry. 3. Now we introduces the possibility that between two bites take one or more swigs of coffee. 4. If the coffee is finished one pour up again.

4

Solutions to the exercise of "Structure Chart" Some proposed solutions 1. Sequence, selection, iteration. Structure chart. The year has four seasons

Many ring signals before answer

Bil eller buss till skolan

En kjedja består av länkar

2.1 Sequence, selection, iteration. Structure chart. 7. Sequences: A 8. Sequence parts: B C 9. Iterations: D C F 10. Iteration parts: G F J 11. Selections: B E 12. Selection parts: D E H I

Structure chart

2.2 Sequence, selection, iteration. Structure chart. Busy signal

Blocking tone

Redirection tone

2.3 Sequence, selection, iteration. Structure chart. Correct train set:

2.4 Correct the structure chart

5

2.5 Name standard

2.6 Olle Monday schedule

2.7 Debate

3.1 Pull-Ups – structure chart Describe the flow with a structure chart. Task 1

Task 2

Task 3

6

3.2 Cake – structure chart Solve the task with structure charts. Task 1

Task 2

Task 3

Task 4

proposed solution eat a cake

7

Use this paper for your notes

8