= 18 THEN PRINT “You Qualify” ELSE PRINT “You do not qualify” END IF"> = 18 THEN PRINT “You Qualify” ELSE PRINT “You do not qualify” END IF">

Presentation is loading. Please wait.

Presentation is loading. Please wait.

Coding Design Tools Rachel Gauci. What are Coding Design Tools? IPO charts (Input Process Output) Input- Make a list of what data is required (this generally.

Similar presentations


Presentation on theme: "Coding Design Tools Rachel Gauci. What are Coding Design Tools? IPO charts (Input Process Output) Input- Make a list of what data is required (this generally."— Presentation transcript:

1 Coding Design Tools Rachel Gauci

2 What are Coding Design Tools? IPO charts (Input Process Output) Input- Make a list of what data is required (this generally involves the variables created, that can be manipulated) Processing- Make a list of any calculations that might have to be performed Output- Make a list of everything you are required to output Pseudocode Pseudocode is an informal language that helps programmers develop algorithms. Pseudocode is a "text-based" detail design tool. The rules of Pseudocode are reasonably straightforward. All statements showing "dependency" are to be indented. These include while, do, for, if, else. INPUTPROCESSOUTPUT Fill this in 2ndFill this in lastFill this in 1st IF student's grade is greater than or equal to 60 Print "passed” ELSE Print "failed”

3 Example- Pseudocode Pseudocode’s used to point out the actions in your script. How is this done? You write your script in an informal way, leaving out ; () {} etc. then you put the main words in capitals/ bold making them stand out. Ideally we want to write what we want a particular part of code to look like E.G. #pragma strict var age= 22; function Start() { if (age >= 18) { Debug.Log ("You Qualify"); } else { Debug.Log("You do not qualify"); } } function Update() { } IF AGE >= 18 THEN PRINT “You Qualify” ELSE PRINT “You do not qualify” END IF

4 More Pseudocode https://www.khanacademy.org/com puting/cs/programming/good- practices/p/pseudo-code this is for drawings and in its simplest form explains pseudo code and why we use it. However this demonstration is not how I want it set out. http://myweb.lmu.edu/dondi/share/i ntro/pseudocode2js-v02.pdf Set total to zero Set grade counter to one WHILE grade counter is less than or equal to ten Input the next grade ADD the grade into the total Set the class average to the total divided by ten PRINT class average. START Program Enter two numbers A, B Add the numbers together PRINT sum END program

5 Example- IPO charts #pragma strict var age= 22; function Start() { if (age >= 18) { Debug.Log ("You Qualify"); } else { Debug.Log("You do not qualify"); } } function Update() { } INPUTPROCESSOUTPUT AgeUser puts in age -- it is determined whether the person is 18 or > < Results whether “You Qualify” or “You do not Qualify”

6 LOOPS FOR LOOPS- the loop is repeated a "specific" number of times, determined by the program or the user. The loop "counts" the number of times the body will be executed. This loop is a good choice when the number of repetitions is known, or can be supplied by the user. While Loops: The loop must repeat until a certain "condition" is met. If the "condition" is FALSE at the beginning of the loop, the loop is never executed. The "condition" may be determined by the user at the keyboard. The "condition" may be a numeric or an alphanumeric entry. This is a good, solid looping process with applications to numerous situations.

7 The for loop is used to repeat a section of code known number of times. Sometimes it is the computer that knows how many times, not you, but it is still known. Some examples: Unknown number of times: "Ask the User to Guess a pre-determined number between 1 and 100". You have no way of knowing how many guesses it will take. "Randomly look in an array for a given value." You have no way of knowing how many tries it will take to find the actual value. Note: this is a made-up example, because you would never randomly look into an array to find a value. You would always start at the front of the array and look one element at a time until you found the item or got to the end of the array. Known number of times: Compute the average grade of the class. While you (the programmer) might not know how many grades exist in the class, the computer will know. Usually this is accomplished by using the "length" function on an array. Print the odd numbers from 1 to 1001. Search a list (array) of numbers for the biggest grade. Again, the computer "knows" how many grades there are, so a for loop is appropriate.


Download ppt "Coding Design Tools Rachel Gauci. What are Coding Design Tools? IPO charts (Input Process Output) Input- Make a list of what data is required (this generally."

Similar presentations


Ads by Google