► Main page, Previous page

Programming primer

OUTPUT

<font 14px/arial,sans-serif;;inherit;;inherit> Topic: How we find out what data are in computer? </font>

<font 14px/arial,sans-serif;;inherit;;inherit> 7 and 8 period </font>

<font 14px/arial,sans-serif;;inherit;;inherit> Repetition: Drawing </font>

red.jpg

<font 14px/arial,sans-serif;;inherit;;inherit> Means: Put as many grains you want in the red drawer. </font>

<font 14px/arial,sans-serif;;inherit;;inherit> New teaching material: </font>

<font 14px/arial,sans-serif;;inherit;;inherit> Question: What does mean the drawing you see below? (Attention! The direction of the arrow is changed.) </font>

output_slika1.jpg

<font 14px/arial,sans-serif;;inherit;;inherit>This instruction will not represent the request “Empty the red drawer” as somebody could assume. This drawing means: “Check how many grains are there in the reed drawer and write this number in your notebook or on the blackboard, The grains remain in the drawer.”</font>

<font 14px/arial,sans-serif;;inherit;;inherit> The name of such an instruction is OUTPUT. After OUTPUT data remains in Mema, but its contents is copied somewhere outside of Mema, for instance in the notebook. </font>

<font 14px/arial,sans-serif;;inherit;;inherit> A riddle: What you can give away and not lose? Answer: Friendship (Now we can see that data behave is the same way.) </font>

<font 14px/arial,sans-serif;;inherit;;inherit>Assignment: Put in every drawer of your Mema a number of grains (as many you want). Write in your notebook how many grains are there in the next drawers:</font>

output_slika2.jpg

<font 14px/arial,sans-serif;;inherit;;inherit>This is an assignment with many correct answers, because every child fill in his or hers Mema with an arbitrary number of grains. But in the moment when he or she write the numbers, the numbers must be the same as the numbers in drawers given by instructions.</font>

  • <font 14px/arial,sans-serif;;inherit;;inherit>To check the correct answers the teacher has to check the Memas and the notebooks of every child. The contents in drawers given by instructions will be compared with numbers in the notebook.</font>
  • <font 14px/arial,sans-serif;;inherit;;inherit>If the numbers in notebook are 4,5,3 and 2 then the contents of red drawer must be 4 in blue 4, in green 3 and in yellow 2.</font>

<font 14px/arial,sans-serif;;inherit;;inherit>Assignment: Write (draw) a program which put in every drawer of your Mema a number of grains (as many you want), and then ask you to write in your notebook how many grains are there in red, blue, yellow, black and green drawer.</font>

<font 14px/arial,sans-serif;;inherit;;inherit> Comment: </font> <font inherit/arial,sans-serif;;inherit;;inherit>Students instructions use only colors without text as is our drawings.</font>

<font 14px/arial,sans-serif;;inherit;;inherit> Solution: </font>

output_slika3.jpg

Some additional questions the teacher can ask for better understanding:

  • <font 14px/inherit;;inherit;;inherit>How many grain are there in the gray drawer? (Answer: The students count the grains in the gray drawer and answer.)</font>
  • <font 14px/inherit;;inherit;;inherit>Why this number is not in your notebook? (Answer: Because there was not an OUTPUT for the gray drawer or because it was not requested or similar.)</font>
  • <font 14px/inherit;;inherit;;inherit>How many OUTPUT instruction are in program? (Answer: 4.)</font>
  • <font 14px/inherit;;inherit;;inherit>What would happen if two drawer of a Mema were of red color? (This would be confusing, If we had an INPUT or OUTPUT addressing red drawer we could not know which one (or both) to fill in or copy on output.)</font>
  • <font 14px/inherit;;inherit;;inherit>Why are the drawers of different colors? (Answer: Just to be different.)</font>

<font 14px/inherit;;inherit;;inherit> Assignment: Draw the instruction which will empty the red drawer.</font>

<font 14px/inherit;;inherit;;inherit> Tip: First all have to perceive that this can not be done by OUTPUT instruction.!!!!!</font>

<font 14px/inherit;;inherit;;inherit> Repetition: What does this instruction do??</font>

output_slika1.jpg

<font 14px/inherit;;inherit;;inherit>Answer: Wit this instruction a request is given to write out the contents of red drawer without changing its contents.</font>

red.jpgThe red drawer may be emptied by putting in it 0 grains (none).

PROCESSING

Clicking the link PROCESSING you can go to the next lesson.

en/izlaz.txt · Zadnja izmjena: 2016/03/01 08:10 od sbabic
Na vrh
CC Attribution-Share Alike 4.0 International
chimeric.de = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0