Programming : Unit 5-11 Flashcards
What is execution?
- the process by which a computer carries out the instructions of a computer program.
What are the 5 data types?
- Integer.
- Real or float.
- Boolean
-Character - string
What is Integer?
Real or float?
Boolean?
Character?
String?
Integer: used to store whole numbers without a fractional part.
Real/float: Used to store numbers with a fractional part.
Boolean: has two possible values: True or false.
Character: a letter, a symbol, a number or a space.
String: A set of characters which can include spaces and numbers they are treated as texts not numbers.
What is initialize?
- to set variables to their starting values at the beginning of a program or sub program.
What is initialization?
- the process of assigning an initial value to a variable.
What is type coercion?
- the process of converting the value stored in a variable from one data type to another.
What are the 2 types of operators?
- relational operator.
- logical operator.
What is the relational operator?
logical operator?
- A relational operator is an operator that tests the relationship between two entities.
- A logical operator is a Boolean operator using AND, OR and NOT.
What are the 6 relational operators?
Equal to , greater than, greater than or equal to, less than, less than or equal to, not equal to.
What are the 3 logical operators?
- and/ or/ not.
What are the 2 types of iteration?
- indefinite iteration.
- definite iteration.
What is a block of code?
- a grouping of two or more code statements.
What is the use of each technique?
a. comments.
b. descriptive names.
c. Indentation.
d. white space.
- comments should be used to explain what each part of the program does.
- using descriptive identifiers for variables, constants, and subprograms helps make their purpose clear.
- indentation. makes it easier to see where each block of code starts and finishes.
- white space. adding blank lines between different blocks of code makes them stand out.
What is a string?
- a sequence of characters. they can be letters, numbers, symbols, punctuation marks, or space.
What is a function?
- a subprogram that performs a specific task and returns a value to the main program. (there are built-in functions for use but could make your own)
What is string traversal?
- using a loop to cycle through each character in a string.