100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.6 TrustPilot
logo-home
Exam (elaborations)

WGU C960 Module 1 Algorithm Structures Verified Questions And Answers With Latest Updates

Rating
-
Sold
-
Pages
8
Grade
A
Uploaded on
30-05-2025
Written in
2024/2025

WGU C960 Module 1 Algorithm Structures Verified Questions And Answers With Latest Updates










Whoops! We can’t load your doc right now. Try again or contact support.

Document information

Uploaded on
May 30, 2025
Number of pages
8
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

  • wgu c960 module 1
  • wgu c960

Content preview

C960: Supplementary Practice Unit 1


C960 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




Use 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?
(b) What is the final value of val.


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




? When
42
When 10

Algorithm 3

1: procedure
2: count=0

, C960: Supplementary Practice Unit 1




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

4 This question assumes familiarity with modular arithmetic discussed in Unit 2. In the pseudo-code below, Line 7
performs string addition (concatenation), for example:
"a" + "b" = "ab". Even if the addends look like numbers, it will still do string addition: "2" + "3" =
"23". Answer the questions below.
a. What is the output of the algorithm when x = 99 and b = 2?
b. What is the output of the algorithm when x = 1642 and b = 8?


Algorithm 4
1: procedure EXPAND(x, b) 2: Input:
integers x and b
3: Output: outVal, x written in base b
4: 5:
outVal = an empty string
6: while (x>0) do
7: outVal = string(x mod b) + outVal
8: x = x div b
9: return(outVal)




Page 2 of 8

Get to know the seller

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.
Nipsey Chamberlain School Of Nursing
View profile
Follow You need to be logged in order to follow users or courses
Sold
2047
Member since
5 year
Number of followers
1524
Documents
14949
Last sold
1 day ago
LECT EXAMS

FOR THE BEST ASSIGNMENTS,TEST BANKS,EASSY AND TO HELP IN TUTORING I have done papers of various topics and complexities. I am punctual and always submit work on-deadline. I write engaging and informative content on all subjects. Send me your research papers, case studies, psychology papers, etc , and I’ll do them to the best of my abilities. Writing is my passion when it comes to academic work. I’ve got a good sense of structure and enjoy finding interesting ways to deliver information in any given paper. I love impressing clients with my work, and I am very punctual about deadlines. Send me your assignment and I’ll take it to the next level. I strive for my content to be of the highest quality. Your wishes come first— send me your requirements and I’ll make a piece of work with fresh ideas, consistent structure, and following the academic formatting rules For every student you refer to me with an order that is completed and paid transparently, I will do one assignment for you, free of charge!!

Read more Read less
4.1

364 reviews

5
213
4
55
3
55
2
14
1
27

Recently viewed by you

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

Frequently asked questions