jagomart
digital resources
picture1_Hello World Pdf 184512 | Exercises Pseudocode


 165x       Filetype PDF       File size 0.03 MB       Source: www.peterbeerli.com


File: Hello World Pdf 184512 | Exercises Pseudocode
think like a programmer write pseudocode for each of the problems 1 you have an egg in shell salt a pan and butter produce a scrambled egg 2 what is ...

icon picture PDF Filetype PDF | Posted on 01 Feb 2023 | 2 years ago
Partial capture of text on file.
    Think like a programmer
    [or better: think like a cook!]
    Write pseudocode for each of the problems
     1.  You have an egg (in shell), salt, a pan, and butter; produce a scrambled egg.
     2.  what is the pseudo code for printing hello world 2 times
     3.  Calculate and print the result of Square root of one over x squared for all x smaller than 5.
     4.  Imagine a square consisting out of 3x3 tiles, what is the pseudocode to visit all four corner tiles, using
      pseudo commands moveforward(), turnleft(); you start (S) in the center
       X      X
          S
       X      X
     5.  Same exercise as before but the square has now 301x301 tiles, write pseudocode that uses loops.
     6.  Write code that takes the last 3x3 example but think of the corner tiles as lighted up (X), your job is to turn
      them off using the function toggleLight() once you are on the corner tile, once you turned off all corner
      lights go back to the middle and turn the light on (take a hint from the function name). The final result looks
      like this:
       0     0
          X
       0     0
     7.  Do a similar pseudocode, but write a function for the subset of the tasks (e.g. change_corner lights()) for
      this layout (you do not need to go back to the center):
        X  X     X  X
        X           X
              S
        X           X
        X  X     X  X
     8.  Rewrite your pseudocode assuming you have only the functions turnOn() and turnOff() (Hint: test
      whether the light (X) is on (present) or not (absent) before you turnOff or turnOn.
     9.  write pseudocode for a program that takes a simple calculation like 4 + 5 or 3 / 4 or 24 * 3 or 10 - 2 and
      spits out the result.
    Translate pseudo code into real code
    If you have time, translate all the pseudocode into real code. Start with the first (easy) ones.
    (Peter Beerli, ISC3313, September 2016)
The words contained in this file might help you see if this file matches what you are looking for:

...Think like a programmer write pseudocode for each of the problems you have an egg in shell salt pan and butter produce scrambled what is pseudo code printing hello world times calculate print result square root one over x squared all smaller than imagine consisting out tiles to visit four corner using commands moveforward turnleft start s center same exercise as before but has now that uses loops takes last example lighted up your job turn them off function togglelight once are on tile turned lights go back middle light take hint from name nal looks this do similar subset tasks e g change layout not need rewrite assuming only functions turnon turnoff test whether present or absent program simple calculation spits translate into real if time with rst easy ones peter beerli isc september...

no reviews yet
Please Login to review.