C173 Scripting and Programming Foundations, Exam Review. Latest update.
C173 Scripting and Programming Foundations, Exam Review. Latest update. 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? - -10 What does = mean? - -Assignment What is the value of x? x = 2 y = 3 x = x * y x = x * y - -18. x is first assigned with 2. Then x is assigned with 2 * 3, or 6. Finally, x is assigned with 6 * 3, or 18.
Written for
- Institution
- Western Governors University
- Course
- WGU C173 Scripting And Programming
Document information
- Uploaded on
- August 24, 2023
- Number of pages
- 29
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
c173 scripting and programming foundations exam r
Also available in package deal