WGU C960 Discrete Math 2, Questions and answers, 100% Accurate, VERIFIED | 153 Pages
1.4.3: If-else-statement 1) What is the value of abs after the following lines of code are run? x := 2 If ( x > 0 ) abs := x Else abs := -x End-if 2 The condition ( x > 0 ) evaluates to true because the value of x is 2. The line abs := x is executed and the line abs := -x is skipped. Therefore the final value of abs is 2. 1.4.3: If-else-statement 2) What is the value of abs after the following lines of code are run? x := -2 If ( x > 0 ) abs := xElse abs := -x End-if
Written for
- Institution
-
Western Governors University
- Course
-
WGU C960
Document information
- Uploaded on
- November 24, 2023
- Number of pages
- 153
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
wgu c960 discrete math 2 questions and answers 1