Scripting & Programming Foundations Final Exam Q&A, Exams of Computer Science

A compilation of verified questions and answers for a scripting and programming foundations final exam. It covers core programming concepts such as variables, data types, loops, control structures, arrays, and functions. Additionally, it explains principles of object-oriented programming, software development life cycles (sdlc), and distinctions between compiled, interpreted, and markup languages. This material provides a comprehensive and accurate reference for exam preparation and review, making it a valuable resource for students preparing for their final exam. It includes questions on agile approaches, programming libraries, and language characteristics.

Typology: Exams

2025/2026

Available from 10/27/2025

PassingMaster
PassingMaster šŸ‡°šŸ‡Ŗ

3.7

(15)

2.2K documents

1 / 40

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
WGU D278 – Scripting & Programming Foundations
(Western Governors University) – Final Exam Verified
Q & A Compilation
Introduction:
This document contains the complete set of verified questions and
answers for the WGU D278 Scripting and Programming Foundations
final exam. It covers core programming concepts including variables,
data types, loops, control structures, arrays, and functions.
Additionally, it explains principles of object-oriented programming,
software development life cycles (SDLC), and distinctions between
compiled, interpreted, and markup languages. The material provides
a comprehensive and accurate reference for WGU D278 exam
preparation and review.
Exam Questions and Answers
47. A company has a new project it wishes to implement to track
and analyze employee and customer interactions. The company
leadership determines that the system should support direct data
entry as well as automated data capture of phone calls and emails.
Which phase of the waterfall process is occurring?--- correct
answer --- Analysis
48. A programmer shows a program's first version to a customer.
The customer provides feedback, which causes the programmer to
change the goals of the program.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28

Partial preview of the text

Download Scripting & Programming Foundations Final Exam Q&A and more Exams Computer Science in PDF only on Docsity!

WGU D278 – Scripting & Programming Foundations

(Western Governors University) – Final Exam Verified

Q & A Compilation

Introduction: This document contains the complete set of verified questions and answers for the WGU D278 Scripting and Programming Foundations final exam. It covers core programming concepts including variables, data types, loops, control structures, arrays, and functions. Additionally, it explains principles of object-oriented programming, software development life cycles (SDLC), and distinctions between compiled, interpreted, and markup languages. The material provides a comprehensive and accurate reference for WGU D278 exam preparation and review. Exam Questions and Answers

  1. A company has a new project it wishes to implement to track and analyze employee and customer interactions. The company leadership determines that the system should support direct data entry as well as automated data capture of phone calls and emails. Which phase of the waterfall process is occurring? --- correct answer --- Analysis
  2. A programmer shows a program's first version to a customer. The customer provides feedback, which causes the programmer to change the goals of the program.

In which phase of an agile approach are goals changed based on customer feedback? --- correct answer --- Analysis

  1. A programmer shows a program's first version to a customer. Based on feedback, the programmer begins writing a second version of the program. In which phase of an agile approach does the writing of a second version of the program occur? --- correct answer --- Implementation
  2. A programmer shows a program's first version to a customer. Based on feedback, the programmer creates a second version, and then has a colleague run the second version on numerous inputs to ensure outputs are correct. Which phase of an agile approach is that colleague carrying out? --- correct answer --- Testing
  3. A programmer is currently programming the fourth version of a program. Each version has additional features to satisfy more customers. In which phase of an agile approach does the programming of the fourth version occur? --- correct answer --- Implementation
  4. What does a programmer do first to use an existing programming library?- --- correct answer --- Include the library
  5. What relationship is common among a programming library's functions? --- correct answer --- - Functions all relate to the same purpose
  6. What is an advantage of using a programming library? --- correct answer --- The code has already been tested
  1. Which characteristic specifically describes interpreted languages? --- correct answer --- They can be run one statement at a time
  2. Which operator should be used to determine if a number is evenly divisible by 5? --- correct answer --- %
  3. A car drove 200 miles using 10 gallons of fuel. Which operation should be used to compute the miles per gallon, which is 20? --- correct answer --- Division
  4. A variable should hold a person's height in meters. Which data type should the variable be? --- correct answer --- Float
  5. A variable should hold the names of all past U.S. presidents. Which data type should the variable be? --- correct answer --- String array
  6. A program uses the number of seconds in a minute in various calculations. How should the item that holds the number of seconds in a minute be de- clared? --- correct answer --- Constant integer secondsPerMinute
  7. A program determines if a user's age is high enough to run for U.S. president. The minimum age requirement is 35. How should the item that holds the minimum age be declared? --- correct answer --- Constant integer minAge
  8. Given integer x = 3 and integer y = 5. What is the value of the expression ( x / 2.0) + y? --- correct answer --- 6.
  9. Given float x = 10.2 and float y = 1.0.

What is the value of the expression x / y? --- correct answer --- 10.

  1. What kind of operator is the == in the expression i == 20? --- correct answer --- Equality
  2. What is the purpose of parentheses () in a programming expression? --- correct answer --- To group expressions
  3. Given float x = 3.0. Which expression evaluates to 2.0? --- correct answer --- x / 2 + 0. /2 +.
  4. Which expression evaluates to true only when the user is within 3 years of 21 years, given a variable x containing a user's age? --- correct answer --- ( x >= 18) and ( x <= 24)
  5. Which data type is used for items that are measured in length? --- correct answer --- Float
  6. Which data type should be used to keep track of how many planes are in a hangar? --- correct answer --- Integer
  7. A function should convert hours and minutes to seconds, such as converting 1 hour and 10 minutes to 4,200 seconds. What should be the input to the function? --- correct answer --- Hours and minutes
  8. A function returns a number x cubed. For example, if x is 3, the function returns 3 * 3 * 3, or 27. What should be the input to the function? --- correct answer --- x
  9. A function calculates the weight difference (Diff) given two sample weights (S1 and S2).
  1. What is put to output by the following pseudocode: x = 3 do Put x to output Put " " to output x = x - 1 while x > 0 --- correct answer --- 3 2 1
  2. A programmer has developed the following code: count = 0 while count is less than 5: print 'Hello' What is the result of implementing this code? --- correct answer --- 'Hello' will print indefinitely.
  3. What is the loop expression in the following pseudocode? i = 0 while i < 20 Put i to output i = i + 1 --- correct answer --- i<
  4. What is the loop variable initialization in the following pseudocode? y = 0 s = 100. while y < 10 s = s + (s * 5.0) y = y + 1 --- correct answer --- y = 0
  5. Order the steps needed to output the minimum of x and y from first (1) to last (4). A Declare variable min

B Put min to output C min = x D If y < min, set min = y --- correct answer --- ACDB

  1. Order the steps needed to calculate speed in miles per hour given a start and end location and time traveled in hours from first (1) to last (4). A Put speedMph to output B Declare variables distMiles and speedMph C distMiles = endLocation - startLocation D speedMph = distMiles / timeHours --- correct answer --- BCDA
  2. Order the tasks needed to create a pyramid (large on bottom, small on top) on a table from first (1) to last (4). A Place largest shape. B Clear table C Place smallest shape. D Place middle-sized shape. --- correct answer --- BADC
  3. What does the following algorithm determine? if x == y z = 1 else z = 0 --- correct answer --- Whether x and y are the same
  4. What does the following algorithm accomplish? x = Get next input if x == - 1 Put "Goodbye" to output --- correct answer --- Outputs Goodbye when user types - 1
  1. Which phase of an agile approach would define a hypothesis to find a problem in a program? --- correct answer --- Testing
  2. Which phase of an agile approach would create an executable program? --- correct answer --- Im- plementation
  3. Which phase of an agile approach would create a list of components needed to build an online auction site? --- correct answer --- Design
  4. Which phase of a waterfall approach defines a program's goals? --- correct answer --- Analysis
  5. After a programmer is done writing a program, another person runs the program hundreds of times, each time with different input, checking that each run yields correct output. Which phase of a waterfall approach is the person carrying out? --- correct answer --- Testing
  6. A programmer decides a program should convert U.S. units to metric units and decides to write the program in C++ using several functions. Which phase of a waterfall approach is occurring when the programmer starts writing the program? --- correct answer --- Implementation
  7. Which characteristic specifically describes interpreted languages? --- correct answer --- They can run on any machine having the right interpreter
  8. Program --- correct answer --- Consists of instructions executing one at a time.
  1. Input --- correct answer --- A program gets data, perhaps from a file, keyboard, touchscreen, network, etc.
  2. Process --- correct answer --- A program performs computations on that data, such as adding two values like x + y.
  3. Output --- correct answer --- A program puts that data somewhere, such as to a file, screen, network, etc.
  4. Variables --- correct answer --- To refer to data, like x.
  5. Algorithm --- correct answer --- A sequence of instructions that solves a problem.
  6. Flowchart --- correct answer --- A graphical language for creating or viewing computer programs.
  7. Run execute --- correct answer --- Carrying out a program's statements.
  8. String literal --- correct answer --- Consists of text (characters) within double quotes, as in "Go #57!".
  9. Characters --- correct answer --- Any letter (a-z, A-Z), digit (0- 9), or symbol (~, !, @, etc.).
  10. Newline --- correct answer --- A two-character sequence \n whose appearance in an output string literal causes the cursor to move to the next output line.
  11. Comment --- correct answer --- Text a programmer adds to a program, to be read by humans to better understand the code, but ignored by the program when executing.
  1. Arguments --- correct answer --- Any function input values, appear within ( ), and are separated by commas if more than one.
  2. Parameter --- correct answer --- A function input specified in a function definition.
  3. Loop --- correct answer --- A program that repeatedly executes statements while the expression is true; when false, execution proceeds past.
  4. Pseudocode --- correct answer --- Text that resembles a program in a real programming language but is simplified to aid human understanding.
  5. if else --- correct answer --- A decision and its two branches. Because IF the decision's expression is true then the first branch executes, ELSE the second branch executes.
  6. Boolean --- correct answer --- A type that has just two values: true or false.
  7. While loop --- correct answer --- A loop that repeatedly executes the loop body while the loop's expression evaluates to true.
  8. For loop --- correct answer --- A loop with three parts at the top: a loop variable initialization, a loop expression, and a loop variable update.
  9. Do While loop --- correct answer --- A loop that first executes the loop body's statements, then checks the loop condition.
  10. Array --- correct answer --- An ordered list of items of a given data type.
  1. Function call --- correct answer --- Consists of the function name and parentheses, within which comma-separated arguments (if any) appear.
  2. Analysis --- correct answer --- This first SDLC phase determines the goals and requirements for a system.
  3. Design --- correct answer --- This second SDLC phase defines specifics of how to build a program.
  4. Implementation --- correct answer --- This third SDLC phase involves writing the program.
  5. Testing --- correct answer --- The fourth SDLC phase checks the system functions properly and meets requirements.
  6. Waterfall method --- correct answer --- Each phase is done in sequence, entirely completing one phase before moving to the next phase.
  7. Agile or spiral --- correct answer --- A program can be built by doing small amounts of each phase in sequence, and then repeating.
  8. Universal Modeling Language (UML) --- correct answer --- Is a modeling language for software design that uses ditterent types of diagrams to visualize the structure and behavior of programs.
  9. Use case diagram --- correct answer --- A behavioral diagram used to visually model how a user interacts with a software program.
  10. Class diagram --- correct answer --- A structural diagram that can be used to visually model the classes of a program, including data members and functions.
  1. linear search? --- correct answer --- algorithm that checks each element of a list, in order, until the desired value is found or all elements in the list have been checked
  2. runtime? --- correct answer --- the time the algorithm takes to execute
  3. binary search? --- correct answer --- a search algorithm that starts at the middle of a sorted set of numbers and removes half of the data; this process repeats until the desired value is found or all elements have been eliminated.
  4. heuristic? --- correct answer --- technique that accepts less accurate solution to improve execution speed
  5. SDLC? --- correct answer --- Systems Development Life Cycle
  6. SDLC phases? --- correct answer --- analysis, design, implementation, testing
  7. SDLC analysis? --- correct answer --- defines a programs goals & requirements for system
  8. SDLC design? --- correct answer --- defines specifics of how to build a program ex? --- correct answer --- create a diagram that specifies the require order of events between completed program components
  9. SDLC implementation? --- correct answer --- involves writing the program, building the system according to the design, creates executable program
  1. SDLC testing? --- correct answer --- checks programs meets goals, functions correctly ex? --- correct answer --- define a hypothesis to find a problem in a program
  2. agile/spiral approach? --- correct answer --- program built by doing small amounts of SDLC phase, repeating until complete
  3. waterfall method? --- correct answer --- SDLC occurs sequentially, with one activity starting only after the previous one has been completed
  4. UML? --- correct answer --- Universal Modeling Language modeling language for software design uses ditterent types of diagrams to visualize structure & behavior of programs
  5. structural diagram? --- correct answer --- visualizes static elements of software ex? --- correct answer --- variables and functions
  6. behavioral diagram? --- correct answer --- visualizes dynamic behavior of software ex? --- correct answer --- flow of an algorithm
  7. activity diagram? --- correct answer --- flowchart used to describe the flow of an activity or set of activities
  8. use case diagram? --- correct answer --- used to visually model how a user interacts with a software program, doesn't contain program code behavioral UML
  1. array? --- correct answer --- collection of particular data type (names=string, quantity=integer, price=float, etc.), each entry known as an element
  2. Array characteristics? --- correct answer --- always starts at 0, static data structure, must be declared before use
  3. equality operators? --- correct answer --- Operators == (is equal to) and != (is not equal to) that compare two values.
  4. relational operators? --- correct answer --- ==, !=, >, <, >=, <=
  5. logical operators? --- correct answer --- and, or, not
  6. branches? --- correct answer --- sequence of statements only executed under a certain condition
  7. loop? --- correct answer --- program that repeatedly executes statements
  8. iteration? --- correct answer --- each time the loop runs
  9. white loop? --- correct answer --- A loop that continues to repeat while a condition is true. Ex; While it's raining, grab an umbrella. used when unsure of how many times loop will run
  10. do-while loop? --- correct answer --- Iterate while the condition is true, tells you to something first, action before evaluation EX? --- correct answer --- do { ... this thing } while(condition);
  1. for loop? --- correct answer --- Loops that have a predetermined beginning, end, and increment (step interval). used when you already know how many times to repeat.
  2. algorithm? --- correct answer --- sequence of instructions that solves a problem
  3. flowchart? --- correct answer --- graphical language for creating/ viewing computer programs
  4. program? --- correct answer --- a list of statements or actions to accomplish a task in a computer program
  5. interpreter? --- correct answer --- tool that runs programs statements one at a time can run on any machine that has an interpreter ex? --- correct answer --- python, javascript
  6. "run"? --- correct answer --- act of carrying out statements' actions
  7. statement? --- correct answer --- specific action in program
  8. string literal? --- correct answer --- Text (characters) within double quotes. ex? --- correct answer --- "Go #57!"
  9. cursor? --- correct answer --- indicates where the next output item will be placed in the output
  10. newline? --- correct answer --- special 2 character sequence \n \n is invisible in output
  11. comments? --- correct answer --- used by a programmer to explains sections of code ignored by the compiler