WGU - SCRIPTING AND PROGRAMMING FOUNDATIONS WITH COMPLETE VERIFIED SOLUTIONS
Program Consists of instructions executing one at a time. Input A program gets data, perhaps from a file, keyboard, touchscreen, network, etc. Brainpower 0:02 / 0:15 Process A programs performs computations on that data, such as adding two values like x + y. Output A programs puts that data somewhere, such as to a file, screen, network, etc. Computational thinking Creating a sequence of instructions to solve a problem. Algorithm A sequence of instructions that solves a problem. Statement Carries out some action and executing one at a time. String literal Consists of text (characters) within double quotes, as in "Go #57!". Cursor Indicates where the next output item will be placed in the output. Newline A special two-character sequence n whose appearance in an output string literal causes the cursor to move to the next output line. The newline exists invisibly in the output. Comment Text added to a program, read by humans to understand the code, but ignored by the program when executed. Whitespace Refers to blank spaces (space and tab characters) between items within a statement, and to newlines. Whitespace helps improve readability for humans, but for execution purposes is mostly ignored. Pseudocode Text that resembles a program in a real programming language but is simplified to aid human understanding. Assignment statement Assigns a variable with a value, such as x = 5. An assignment statement's left side must be a variable. The right side is an expression.Examples: x = 5, y = a, or z = w + 2. = In programming, = is an assignment of a left-side variable with a right-side value. It does not represent equality like in mathematics. Variable declaration Declares a new variable, specifying the variable's name and type. Identifier A name created by a programmer for an item like a variable or function. An identifier must: be a sequence of letters (a-z, A-Z), underscores (_), and digits (0-9), AND start with a letter or underscore. Reserved word or keyword A word that is part of the language, like integer, Get, or Put. A programmer cannot use a reserved word as an identifier. Lower camel case Abuts multiple words, capitalizing each word except the first, such as numApples. Underscore separated Words are lowercase and separated by an underscore, such as num_apples. Expression A combination of items, like variables, literals, operators, and parentheses, that evaluates to a value. Example: 2 * (x+1) Literal A specific value in code, like 2. Operator A symbol that performs a built-in calculation, like the operator + which performs addition. Unary minus The subtraction sign (-) used as a negative. Note about integer literal Commas are not allowed, so 1,333,555 must be written as 1333555. Incremental development The process of writing, compiling, and testing a small amount of code, then writing, compiling, and testing a small amount more (an incremental amount), and so on. Floating-point number A real number, like 98.6, 0.0001, or -666.667. Floating-point literal A number with a fractional part, even if that fraction is 0, such as 1.0, 0.0, or 99.573. Function A list of statements executed by invoking the function's name, with such invoking known as a function call. Type conversion A conversion of one data type to another, such as an integer to a float. Implicit conversion When a program automatically performs several common conversions between integer and float types (as well as others). Type cast Converts a value of one type to another type. String A sequence of characters, like "Hello". Boolean Refers to a quantity that has only two possible values, true or false. Array An ordered list of items of a given data type, like an array of integers or an array of floats. Array indices start from 0, not 1. Constant A named value item that holds a value that cannot change. Element Each item in an array. Index In an array, each element's location number. Scalar variable A single-item (non-array) variable. Branch A sequence of statements only executed under a certain condition. Nested branches A branch's statements can include any valid statements, including another if-else branch. Equality operator Checks whether two operand's values are the same (==) or different (=!). Note that equality is ==, not just =. Relational operator Checks how one operand's value relates to another, like being greater than. Logical operator Treats operands as being true or false, and evaluates to true or false. Logical operators include and, or, not. Epsilon The difference threshold indicating that floating-point numbers are equal. if-else statement An if expression with the true branch's sub-statements, followed by an else part with any false branch sub-statements. if statement An if expression followed by sub-statements, with no else part. if-elseif statement Starts with an if expression, followed by elseif expressions, and ending with else; when a program reaches the statement, exactly one of those branches will execute. When the else branch has no statements, the else part is omitted.
Written for
Document information
- Uploaded on
- November 18, 2023
- Number of pages
- 9
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
wgu scripting and programming foundations
Also available in package deal