click below
click below
Normal Size Small Size show me how
Lesson 2 CP Intro
My lesson 2, online studies
| Question | Answer |
|---|---|
| Every scripting/programming languages different set of rules | Syntax |
| way of writing instructions in something close to natural English but related typical to programming languages | Pseudocode |
| performs different computations or actions depending on whether a condition is true or false | control statements |
| If (some logical condition is met) THEN (do something) ElSE (do something else | if-then-else statements |
| The(do something) part of the if then else statement | True Branch |
| (Do something else) part | false branch |
| IF (message subj. starts with X) THEN (delete message) | If-then statements |
| WHILE (there are messages not read) process message END WHILE | while loop |
| statement lets the computer know which instructions are part of the loop and where the loop ends. | End While |
| DO process message UNTL (no more msg) | do until loop |
| Do different program languages use a loop? | Yes, but different terms and syntaxes ...concept universal |
| name used to store and refer to a value.. where data items live | Variable |
| What do variables provide ? | Convention for naming, storing and retrieving different kinds of information (like data numbers names & letters) |
| A variable set it to store the number five by .... Count =5 | count |
| if you add count to a number, it's just as if you added 5. total = count + 2 | total |
| number 1,2,3,4,5.... w/ no decimal | integers |
| you set up & never change. real constant : pi pi= 3.14159These are variables whose values | Constants |
| In most languages do you need to define the type of information you're going to use? | Yes, define the type of information used to store..type like number, letter or something else. or a collection of variables. integer: Count,total |
| What is a list or an array like? | A grocery list, put everything you need onto one list |
| most program languages can step thru a list of data one item at a time using control structure such as this | for-end for |
| Program languages also enable to pick an individual item from a list | Index |
| structure holds onto values in order they're added, enables you to get at them in terms of their position relative to the top of ___ | stack |
| Due to conventions that started back in the mists of time, many languages consider index of the ____ item in an array to be zero | first |