• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 12 pages
Exam (elaborations)

WGU C960 Supplementary Practice Module 1 Algorithm Structures With 100% accurate solutions + rationales

Document preview thumbnail
Preview 2 out of 12 pages

WGU C960 Supplementary Practice Module 1 Algorithm Structures With 100% accurate solutions + rationales

Content preview

FOR MORE EXAMS
Unit 1
EMAIL:


WGU C960: Supplementary Practice
Module 1: Algorithm Structures With 100%
accurate solutions + rationales




Module 1: Algorithm Structures




Algorithm 1
1: procedure
2: sum = 0
3: for (i=2, i<n, i=i+3) do
4: if i mod 2 == 0
5: sum = sum + i



Solution: sum = 44
With i starting at 2 and incrementing by 3 every iteration, i will iterate
through the values 2, 5, 8, 11, 14, 17, and 20. The if statement means sum will
only be updated when i is even, adding 2, 8, 14, and 20 for a total of 44


2Use the pseudo-code below to answer the following question.
(a) Without working through the pseudo-code, how many times with val be
updated in Line 7?
Solution: 24
The loop in line 5 will iterate 4 times. The loop in line 6 will iterate 6 times.
Since they are nested, we multiply and val will be updated 4 · 6 = 24 times.




Suggestions or errors? Thursday 8th September, 2022
Email the IT Math Team

, C960: Supplementary Practice Unit 1


(b) What is the final value of val.
Solution: val = 210
The algorithm loops through all possible combinations of x and y, multiplies
them, and adds them to val. In the end, we get
1· 1 + 1 · 2 + 1 · 3 + 1 · 4 + 1 · 5 + 1 · 6 +
2· 1 + 2 · 2 + 2 · 3 + 2 · 4 + 2 · 5 + 2 · 6 +
3· 1 + 3 · 2 + 3 · 3 + 3 · 4 + 3 · 5 + 3 · 6 +
4 · 1 + 4 · 2 + 4 · 3 + 4 · 4 + 4 · 5 + 4 · 6 = 210


Algorithm 2

1: procedure
2: dFour = [1, 2, 3, 4]
3: dSix = [1, 2, 3, 4, 5, 6]
4: val = 0
5: for (x in dFour) do
6: for (y in dSix) do
7: val = val + x·y

3 Using the pseudo-code below, what is the ending value for count when n = 100?
When n = 10,000?
When n = 1042?

Algorithm 3

1: procedure
2: count=0
3: while (n>1) do
4: count++
5: n = n/10



Solution:
When n = 100, count will end at 2.



Suggestions or errors? Page 2 of 12 Thursday 8th September, 2022
Email the IT Math Team

Document information

Uploaded on
April 3, 2026
Number of pages
12
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$20.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.
BRAINBOOSTERS
4.5
(356)
Sold
806
Followers
258
Items
26245
Last sold
19 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