Chapter 9: Algorithms and Programming

0.0(0)
studied byStudied by 4 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/114

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

115 Terms

1
New cards
Individual items
________ in a list are called elements and are accessed by position using an index.
2
New cards
REMOVE command
The ________ deletes the element at the provided index position and shifts the remaining elements one position to the left.
3
New cards
Integers
________ can be used in mathematical operations and expressions, whereas strings (text fields) can not.
4
New cards
Modulus math
________ uses division but only provides the remainder as the answer, not the quotient.
5
New cards
CAN_MOVE
________ can be used in an IF statement in your code to navigate through the maze.
6
New cards
single equals
In many programming languages, a(n) ________ sign,=, is used as the assignment operator.
7
New cards
Procedural abstraction
________: You only need to know the name of the procedure, the number and type of parameters, and the output to expect.
8
New cards
commands
There are four ________ you are responsible for understanding and using.
9
New cards
Algorithms
________ have the potential to solve many problems once the programs are written for them to run.
10
New cards
Readability
________ is important to help programmers understand a program.
11
New cards
MOD
________ is the symbol used for modulus math in many programming languages.
12
New cards
Pseudocode
________ can not run on computers and needs to be translated to a programming language to do so.
13
New cards
Variables
________ are placeholders for values a program needs to use.
14
New cards
triangle
The ________ represents the robots starting point and the direction it is facing.
15
New cards
Procedures
________ have an optional feature called a return statement.
16
New cards
decidable problem
A(n) ________ is one where an algorithm can be written that results in a correct "yes "or "no "answer for all inputs.
17
New cards
REPEAT
The code that is repeated is indented underneath the ________ statement and within the braces, { }, just like with the IF /ELSE statements.
18
New cards
Clarity
________ refers to how easy it is to understand.
19
New cards
Relational operators
________ are used with Boolean values.
20
New cards
INPUT
________): (It accepts data from the user, usually from the keyboard.
21
New cards
text fields
A program may need variables for numbers, both integers and real numbers, as well as ________ and Boolean values.
22
New cards
INSERT command
The ________ causes elements to the right of the indicated index position, i, to shift right one position to make room for the new element.
23
New cards
Expressions
________ are calculations to be evaluated to an answer or single value.
24
New cards
API documentation
The ________ provides the information needed to set up the interface and use the newly connected software.
25
New cards
algorithm
is a set of steps to do a task. 
26
New cards
Natural language
________ is our native speaking and writing language, so it is much easier for people to use and understand.
27
New cards
Multiple expressions
________ can be combined using the logical operators AND, OR, and NOT.
28
New cards
Parameters
________ allow the calling program to send values to the procedure.
29
New cards
Heuristic approach
________: This is an approach that may not be optimal or the best but is close enough to use as a solution.
30
New cards
Data types
________ are the way computers assign some meaning to these binary digits.
31
New cards
languages
Programming ________ are very strict with their syntax, which is like their grammar and structure.
32
New cards
Boolean values
________ are one of the foundations of computer code.
33
New cards
API
________ stands for "Application Programming Interface ..
34
New cards
operator
For the OR ________, either or both of the operands can be true for the condition to be true.
35
New cards
Efficiency
________ can be determined by mathematically proving it and informally measured by actually running it on datasets of different sizes and measuring how long it took and the memory resources needed.
36
New cards
optimization problem
A(n) ________ is one that should find the best solution for the problem.
37
New cards
random numbers
Generating ________ is a frequently needed feature in programs.
38
New cards
Algorithms
________ are implemented with software.
39
New cards
Pseudocode
________ is used to map out a programs structure before beginning to write the code and uses a combination of natural and programming languages.
40
New cards
Variables
________ are data abstractions because we do not need to know the details of how and where the values are stored in memory.
41
New cards
Integers
________ are whole numbers.
42
New cards
text fields
Strings are ________ that are just a series of characters and are denoted with quotation marks around the string field.
43
New cards
Procedures
________ are also called functions in some programming languages.
44
New cards
algorithm
A(n) ________ is a set of steps to do a task.
45
New cards
Variables
________ can be used in expressions, both mathematical and textual.
46
New cards
Algorithms
________ can be written in several ways.
47
New cards
There are four main data types you should understand for the exam
strings, integers, real (fractional) numbers, and Booleans
48
New cards
This loop will repeat a specified number of times
"n" is a variable that must be set to a positive integer for the loop to run
49
New cards
Combining Algorithms
One of the key features of algorithms is that once they are created, you can use them over and over, combine them for more complex problem solving, or modify them for a new use
50
New cards
LINEAR SEARCH
Linear searches, also called sequential searches, check each individual record, starting at the beginning and going to the end, one after the other in order to either find the desired data or to determine it is not in the dataset
51
New cards
BINARY SEARCH
Binary searches are far more efficient than linear searches
52
New cards
Procedural abstraction
You only need to know the name of the procedure, the number and type of parameters, and the output to expect
53
New cards
Built-in Procedures
Built-in procedures are prewritten and tested code that are included with the programming language
54
New cards
DISPLAY()
DISPLAY() is a built-in procedure used for this course on the exam
55
New cards
INPUT()
It accepts data from the user, usually from the keyboard
56
New cards
Simulations
Simulations are designed to represent and mirror the real world for testing
57
New cards
Heuristic approach
This is an approach that may not be optimal or the best but is close enough to use as a solution
58
New cards
Natural language
is our native speaking and writing language, so it is much easier for people to use and understand.
59
New cards
Programming languages
are very strict with their syntax, which is like their grammar and structure.
60
New cards
Pseudocode
is used to map out a program’s structure before beginning to write the code and uses a combination of natural and programming languages.
61
New cards
Flowcharting
helps to visualize how the program will be structured.
62
New cards
Clarity
refers to how easy it is to understand. 
63
New cards
Readability
is important to help programmers understand a program. 
64
New cards
Variables
are placeholders for values a program needs to use. 
65
New cards
Data types
are the way computers assign some meaning to these binary digits. 
66
New cards
Strings
are text fields that are just a series of characters and are denoted with quotation marks around the string field. 
67
New cards
Integers
can be used in mathematical operations and expressions, whereas strings (text fields) cannot.
68
New cards
**“Fractional” Numbers**
These are numbers with a decimal point, even if a number has 0 (zero) for the decimal value, such as 52.0. 
69
New cards
MOD
is the symbol used for modulus math in many programming languages.
70
New cards
**Assignment Statements**
To assign a value to a variable, the assignment operator is used.
71
New cards
Expressions
are calculations to be evaluated to an answer or single value.
72
New cards
Boolean Values

\
are one of the foundations of computer code.
73
New cards
Boolean expressions
can be simple or compound.
74
New cards
**AND LOGICAL OPERATOR**
To be true, both of the operands on either side of the AND operator must be true when evaluated individually.
75
New cards
**OR LOGICAL OPERATOR**
For the OR operator, either or both of the operands can be true for the condition to be true.
76
New cards
**NOT LOGICAL OPERATOR**
With the NOT operator, if a condition was true, then NOT makes it false.
77
New cards
**Program Statements**
All programs can be written using a combination of only three types of statements.
78
New cards
**Sequential**
These are statements that are executed as written in order in the program.
79
New cards
Selection Statements
These are a key component to many programs.
80
New cards
**Iterative**
are also referred to as repetitive statements or loops.
81
New cards
**REPEAT n TIMES Loop**
This loop will repeat a specified number of times: “n” is a variable that must be set to a positive integer for the loop to run.
82
New cards
**REPEAT UNTIL (Condition) Loop**
has a condition to evaluate at each iteration of the loop.
83
New cards
**Combining Algorithms**
One of the key features of algorithms is that once they are created, you can use them over and over, combine them for more complex problem solving, or modify them for a new use.
84
New cards
**Common Algorithms**
Determining the maximum or minimum number from two or more numbers.
85
New cards
Robots
There are four commands you are responsible for understanding and using.
86
New cards
MOVE_FORWARD
One command the robot can follow is
87
New cards
CAN_MOVE
can be used in an IF statement in your code to navigate through the maze.
88
New cards
Lists
in a program can be a collection of numbers, words, phrases, or a combination of these.
89
New cards
**List Indices**
Individual items in a list are called elements and are accessed by position using an index.
90
New cards
Index positions
are always integers and are enclosed within square brackets \[index\].
91
New cards
INSERT
command causes elements to the right of the indicated index position, i, to shift right one position to make room for the new element.
92
New cards
APPEND
command will add the new element to the end of the list, so no index position is needed.
93
New cards
REMOVE
command deletes the element at the provided index position and shifts the remaining elements one position to the left.
94
New cards
Traversing
a loop that will automatically repeat the code for each element in the list.
95
New cards
**Searching**
deals with finding the needed element from everything in the dataset or determining that it is not there.
96
New cards
Linear searches
also called sequential searches, check each individual record, starting at the beginning and going to the end, one after the other in order to either find the desired data or to determine it is not in the dataset.
97
New cards
Binary searches
are far more efficient than linear searches.
98
New cards
Procedures
are also called functions in some programming languages.
99
New cards
Parameters
allow the calling program to send values to the procedure.
100
New cards
Procedural abstraction
You only need to know the name of the procedure, the number and type of parameters, and the output to expect.