WGU C173 Scripting and Programming Foundations, Exam Questions and answers, Graded A+ 2024 | 29 Pages
What is a variable? - -A name that can hold a value. Might be named x. Then, x = 7 assigns x with 7, which remains in x while the program runs, until x is assigned again. Assignment Statement - -Assigns the variable on the left-side of the = with the current value of the right-side expression Expression - -A mathematical phrase that contains operations, numbers, and/or variables. numApples is initially 5. What is numApples after: numApples = numApples + 3; - -8 Is the following statement valid? x+y =y+x - -Invalid. In programming, the left side of = must be a variable, which will be assigned with the right side's value. Thus, having x + y on the left side doesn't make sense. Is the following assignment statement valid? x + 1 = 3 - -Valid. The left side must be a variable, not an expression like x + 1. In programming, = does not mean equal. = means assign the left-side variable with the right-side's value. Thus, the left side MUST be a variable. x = 9 y = x + 1 What is y? - -102 What does = mean? - -Assignment
Written for
Document information
- Uploaded on
- October 21, 2023
- Number of pages
- 29
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
wgu c173 scripting and programming foundations ex
Also available in package deal