Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 4 out of 195 pages
Exam (elaborations)

WGU C960 OA– Discrete Mathematics II Objective Assessment Review | Full Questions, Correct Answers, and Worked Solutions | Latest 2026/2027 Update | 100% Correct.

Document preview thumbnail
Preview 4 out of 195 pages

WGU C960 OA– Discrete Mathematics II Objective Assessment Review | Full Questions, Correct Answers, and Worked Solutions | Latest 2026/2027 Update | 100% Correct. WGU C960 OA– Discrete Mathematics II Objective Assessment Review | Full Questions, Correct Answers, and Worked Solutions | Latest 2026/2027 Update | 100% Correct.

Content preview

WGU C960 OA– Discrete Mathematics II
Objective Assessment Review | Full Questions,
Correct Answers, and Worked Solutions | Latest
2026/2027 Update | 100% Correct.
Question:

1.4.3: If-else-statement i,-




1)
What is the value of abs after the following lines of code are run?
i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,-




x := 2i,- i,- i,-




If ( x > 0 )
i,- i,- i,- i,- i,- i,-




i,- abs := x i,- i,- i,-




Else abs := -x i,- i,- i,- i,-




End-if?

Answer:
2

The condition ( x > 0 ) evaluates to true because the value of x is 2. The
i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,-



line abs := x is executed and the line abs := -x is skipped. Therefore the
i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,-


final value of abs is 2.
i,- i,- i,- i,- i,-




Question:

,1.4.3: If-else-statement i,-




2)

What is the value of abs after the following lines of code are run?
i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,-




x := -2
i,- i,- i,-




If ( x > 0 )
i,- i,- i,- i,- i,- i,-




i,- abs := x i,- i,- i,-




Else i,-




i,- abs := -x i,- i,- i,-




End-if?
Answer:
2

The condition ( x > 0 ) evaluates to false because the value of x is -2. The
i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,-


line abs := x is skipped and the line abs := -x is executed. Therefore the
i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,-


final value of abs is -x, which is -(-2) = 2.
i,- i,- i,- i,- i,- i,- i,- i,- i,- i,-




Question:
1.5.2: For-loops i,-




Consider the following pseudocode fragment: i,- i,- i,- i,-




sum := 0 i,- i,-




For i = 2 to 5
i,- i,- i,- i,- i,-

,i,- sum := sum + ii,- i,- i,- i,-




End-for



1) What is the value of sum after the second iteration?
i,- i,- i,- i,- i,- i,- i,- i,- i,- i,-




2) How many iterations will the for-loop execute?
i,- i,- i,- i,- i,- i,- i,-




3) What is the final value for sum after executing the for-loop??
i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,-




Answer:

1) 5 i,-




In the first iteration, i = 2. In the second iteration, i = 3. 2 + 3 = 5
i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,-




2) 4 i,-




i = 2, 3, 4, 5. Four iterations
i,- i,- i,- i,- i,- i,- i,-




3) 14 i,-




i = 2, 3, 4, 5. sum = 2 + 3 + 4 + 5
i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,-




Question:

1.6.2: While-loops i,-




product := 1 i,- i,-

, count := 5 i,- i,-




While ( count > 0 )
i,- i,- i,- i,- i,-




i,- product := product⋅count i,- i,-




i,- count := count - 2
i,- i,- i,- i,-




End-while



1) What is the value of product after the second iteration?
i,- i,- i,- i,- i,- i,- i,- i,- i,- i,-




2) How many iterations will the while-loop execute?
i,- i,- i,- i,- i,- i,- i,-




3) What is the final value for product??
i,- i,- i,- i,- i,- i,- i,-




Answer:

1) 15 i,-




In the first iteration, count = 5. In the second iteration, count = 3. 5⋅3 = 15
i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,-




2) 3 i,-




count = 5, 3, 1. Three iterations
i,- i,- i,- i,- i,- i,-




3) 15 i,-




product = 5⋅3⋅1 = 15 i,- i,- i,- i,-




Question:

Document information

Uploaded on
July 23, 2026
Number of pages
195
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$13.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
AcademiaExpert
3.8
(510)
Sold
1987
Followers
766
Items
4508
Last sold
17 hours ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions