click below
click below
Normal Size Small Size show me how
Computer science 106
Chapter 4 and 5
| Question | Answer |
|---|---|
| is a variable that holds a collection or list of related data values | An Array |
| Arrays are one of the most useful facilities available for | organizing our variables |
| Each of the values in an array is called an | Element |
| Each element in the array is identified by an integer value called its | Index |
| Another term for index is | subscript |
| What is the most modern programming languages implement? | zero-based arrays, meaning that array index values begin with 0. |
| Is the number of elements in the array | The array length |
| What is the upper bound of an array | It is the index of the last element |
| What indicates the position of the element in the array. | The Index |
| In Visual Logic you create, or declare, an array using the | Make array command |
| Using an invalid index is, in general, referred to as | An out-of-bounds |
| FOR loops are commonly used with arrays to | initially populate the array to subsequently visit each element in an array and to process its data to print the values found in an array |
| What are two or more arrays whose elements are related by their position in the arrays | Parallel arrays |
| What include commands, such as Forward and Turn Right, that move a virtual pen across the screen so we can draw pictures and diagrams | Visual Logic graphics |
| What allow us to write 're-usable' code. Code that is written once and called many times | Procedures |
| What is a problem solving technique that breaks larger problems into a collection of smaller problems | Structured Design |
| Procedures can accept | Arguments that direct the behavior of the procedure. |
| An actual argument | Is the value passed from the calling code to a procedure |
| The value of the actual argument is copied into the... | Formal argument found in the procedure. |
| What is Structured design | It introduces the idea of using procedures |
| Visual Logic graphics are based on a variation of the | Logo Programming Language |
| What moves the pen a specified number of units forward in the direction it's facing | The Forward command |
| What is the name that rotates the drawing direction to the right a specified number of degrees | The Turn Right command |
| The pen so that nothing is drawn when it is moved | Pen Up: 'lift' |
| Return the pen to the paper | Pen Down |
| It moves the pen to an arbitrary spot (X,Y coordinates) on the paper. (If pen is down a line is drawn) | Move To X,Y |
| Return to 0,0 | Go Home |
| Rotate the pen so it is facing D degrees (0o is North, 90o is East | Set Direction D: |
| The line thickness can be changed with the | Pen Width command |
| The line color can be set using either | Set Color, or Color Forward |
| The Color Forward command moves the pen through the | three base colors of red, green, and blue |
| What is inside a loop and helps us generate a 'rainbow' effect in our drawing is typically used | The Color Forward command |
| The value of the actual argument is copied into the formal argument found in the | procedure |
| Is a piece of information that is communicated between the calling code and the procedure | An argument |
| The argument is referred to as a formal argument in the | definition of the called procedure |
| The argument is referred to as an actual argument at | the time of the call |
| To add a call to our OneFlag procedure in the Main procedure | Called Procedure action |
| If you want to switch between the Main procedure and the sub procedure use | Procedures menu |
| After choosing Procedures and Add New Procedure we'll be shown the | Procedure Edit dialog box |
| After entering the name and pressing OK we'll see | a procedure stub where we can fill in with the procedure's steps |
| In Visual Logic we define a new procedure with the | Procedures menu item |
| A procedure call can be thought of as a | detour to our execution flow |
| The detour is complete when we hit the end of | the procedure |
| Execution continues at the step immediately | following the call |
| is a series of instructions that are grouped together and treated as a single unit | A procedure |
| Procedures are used a lot in a program design approach called | Structured Design a problem is broken into smaller pieces each of which is solved individually |
| Can help us generate some interesting drawing example Try running DrawSpiral.vls And try changing 90 degrees to 91 | LOOP |
| Move the pen to a particular location on the drawing board | Move To and Home |
| Change the direction the pen is facing | Turn Right and Turn Left |
| Change the color and line width the pen writes in | Set Color and Color Forward |
| Graphics commands allow pro-gram output to include | drawings and diagrams |
| What is another name for Logo | Turtle Graphics |
| The pen starts at the? And is initially facing | center (0 0) and facing north |