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 71 pages
Exam (elaborations)

Western Governors University ( Programming )COMPUTERS D278 Questions And Answers Rated A+ New Update Assured Satisfaction

Document preview thumbnail
Preview 4 out of 71 pages

Western Governors University ( Programming )COMPUTERS D278 Questions And Answers Rated A+ New Update Assured Satisfaction

Content preview

1/5/25, 4:56 PM zyBooks




1.1 Programming (general)

Computer program basics

Computer programs are abundant in many people's lives today, carr©yiznygBooouktsa0p1p/0lic5/a2ti5o1n6s:5o6n1703798
Amel Omar
smartphones, tablets, and laptops, powering businesses like Amazon and N e t W
f l i Gx ,UhDe2l 7p 8i nv g1 cars drive
and planes fly, and much more.
A computer program consists of instructions executing one at a time. Basic instruction types are:

Input: A program gets data, perhaps from a file, keyboard, touchscreen, network, etc.
Process: A program performs computations on that data, such as adding two values like x + y.
Output: A program puts that data somewhere, such as to a file, screen, network, etc.

Programs use variables to refer to data, like x, y, and z below. The name is due to a variable's value
"varying" as a program assigns a variable like x with new values.

1.1.1: A basic computer
program.




Computer program
Input (keyboard)
x = Get next input x: 2
2 5
y = Get next input y: 5

z=x+y z: 7
Output (screen)
Put z to output 7




Animation content:
©zyBooks 01/05/25 16:56 1703798
Amel Omar
A generic computer program follows: WGUD278v1
x = Get next input
y = Get next input
z=x+y
Put z to output

Input (keyboard) is as follows:


https://learn.zybooks.com/zybook/WGUD278v1/chapter/1/print 1/71

,1/5/25, 4:56 PM zyBooks

25

Output (screen) is as follows:
7

Animation captions:
01/05/25 16 56 1703798
1. A basic computer program's instructions get input, pr a dp t tp t T s p g a st
Amel Omar
assigns x with what is typed on the keyboard input, in this case 2. WGUD278v1
2. The program's next instruction gets the next input, in this case
3. The program then does some processing, in this case assigning 5. z with x + y (so 2 + 5 yields
7).
4. Finally, the program puts z (7) to output, in this case to a screen.

PARTICIPATIO
N ACTIVITY
1.1.2: A basic computer program.


Consider the example above.

1) How many instructions does the
program have?



Check Show answer


2) Suppose a new instruction were
inserted as follows:

...
z=x+y
Add 1 more to z (new instruction)
Put z to output

What would the last instruction
then output to the screen?
©zyBooks 01/05/25 16:56 1703798
Amel Omar
WGUD278v1
Check Show answer


3) Consider the instruction: z = x + y.
If x is 10 and y is 20, then z is
assigned with .



https://learn.zybooks.com/zybook/WGUD278v1/chapter/1/print 2/71

,1/5/25, 4:56 PM zyBooks




Check Show answer




A program is like a ©zyBooks 01/05/25 16:56 1703798
recipe Amel Omar
WGUD278v1
Some people think of a program as being like a cooking recipe. A recipe consists of
instructions that a chef executes, like adding eggs or stirring ingredients. Likewise,
a computer program consists of instructions that a computer executes, like
multiplying
numbers or outputting a number to a screen.




A first programming activity

Below is a simple tool that allows a user to rearrange some pre-written instructions (in no particular
programming language). The tool illustrates how a computer executes each instruction one at a time,
assigning variable m with new values throughout, and outputting ("printing") values to the screen.


1.1.3: A first programming activity.


Execute the program and observe the output. Click and drag the instructions to change
the order of the instructions, and execute the program again. Not required (points are
awarded just for interacting), but can you make the program output a value greater than
500? How
about greater than 1000?
©zyBooks 01/05/25 16:56 1703798
Run program Amel Omar
WGUD278v1

m:
m = 5

put m


https://learn.zybooks.com/zybook/WGUD278v1/chapter/1/print 3/71

, 1/5/25, 4:56 PM zyBooks
m = m * 2
put m

m = m * m
put m

m = m + 15
put m

©zyBooks 01/05/25 16:56 1703798
Amel Omar
PARTICIPATIO
1.1.4: Instructions. WGUD278v1
N ACTIVITY



1) Which instruction completes the
program to compute a triangle's
area? base = Get next input
height = Get next input
Assign x with base * height

Put x to output
Multiply x by 2
Add 2 to x
Multiply x by 1/2.

2) Which instruction completes the
program to compute the average of
three numbers?
x = Get next input
y = Get next input
z = Get next input

Put a to output
a = (x + y + z) /
3 a = (x + y + z)
/2a=x+y+z

©zyBooks 01/05/25 16:56 1703798
Computational thinking Amel Omar
WGUD278v1
Mathematical thinking became increasingly important throughout the industrial age, to enable people
to successfully live and work. In the information age, many people believe computational
thinking, or creating a sequence of instructions to solve a problem, will become increasingly
important for work and everyday life. A sequence of instructions that solves a problem is called an
algorithm.




https://learn.zybooks.com/zybook/WGUD278v1/chapter/1/print 4/71

Document information

Uploaded on
August 3, 2026
Number of pages
71
Written in
2026/2027
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.
Brainarium
3.8
(333)
Sold
1987
Followers
1046
Items
23954
Last sold
18 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