• 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 4 out of 34 pages
Exam (elaborations)

WGU D278 Scripting and Programming Foundations Pre-Assessment Exam – Complete 220 Questions with Verified Detailed Answers.pdf

Document preview thumbnail
Preview 4 out of 34 pages

Tap on AVAILABLE IN BUNDLE / PACKAGE DEAL to unlock free bonus exams — save more while getting everything you need! You’ll be glad you did! WGU D278 Scripting and Programming Foundations Pre-Assessment Exam – Complete 220 Questions with Verified Detailed A

Content preview

WGU D278 Scripting and Programming
Foundations Pre-Assessment Exam –
Complete 220 Questions with Verified
Detailed Answers
Official Exam Overview:
The WGU D278 Pre-Assessment Exam evaluates learners’ understanding of programming
fundamentals, including data types, variables, constants, control structures, and best practices in
coding. The exam emphasizes writing efficient and maintainable code using proper declarations,
data handling, and program logic.

Exam Coverage Areas:

• Data Types, Variables, and Constants
• Operators and Expressions
• Control Structures (Loops, Conditionals)
• Functions and Procedures
• Input/Output Handling
• Program Logic and Debugging
• Best Coding Practices
• Multiple Choice and Short Answer Question Formats



QUESTION 1: 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 declared?

a) Constant float userTime
b) Variable float userTime
c) Constant integer secondsPerMinute ✅
d) Variable integer secondsPerMinute

Rationale: The number of seconds in a minute is fixed, so it should be declared as a constant
integer to prevent accidental changes and ensure accuracy in calculations.

QUESTION 2: Which declaration is appropriate for a value that may change during program
execution?

a) Constant ✅
b) Variable ✅
c) Literal
d) Static

Rationale: Variables are used for values that can change during program execution, whereas
constants remain fixed.

QUESTION 3: What is the main advantage of using constants in a program?

,a) They save memory
b) They prevent accidental modification of fixed values ✅
c) They speed up program execution
d) They are easier to declare

Rationale: Using constants ensures that critical fixed values cannot be accidentally altered,
improving program reliability and maintainability.

QUESTION 4: Which data type is best suited for storing whole numbers?

a) Float
b) Integer ✅
c) String
d) Boolean

Rationale: Integer types store whole numbers without fractional parts, suitable for counting or
indexing operations.

QUESTION 5: If a program frequently uses a fixed conversion factor, it is best to:

a) Hardcode it in every calculation
b) Declare it as a constant ✅
c) Declare it as a variable
d) Ignore it

Rationale: Declaring a frequently used fixed value as a constant reduces errors, simplifies
maintenance, and improves code clarity.

Page 1 of 32




QUESTION: 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 declared?
A Constant float userTime
B Variable float userTime
C Constant integer secondsPerMinute
D Variable integer secondsPerMinute - ANSWER-Constant Integer secondsPerMinute


QUESTION: 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?
A Constant integer minAge
B Variable integer minAge
C Constant integer 35
D Variable integer 35 - ANSWER-Constant integer minAge


QUESTION: Given integer x = 3 and integer y = 5.
What is the value of the expression ( x / 2.0) + y?
A 5.0
B 6.0

1

, Page 2 of 32




C 6.5
7 7.5 - ANSWER-6.5


QUESTION: Given float x = 10.2 and float y = 1.0.


What is the value of the expression x / y ?
A 0.0
B 1.0
C 10
D 10.2 - ANSWER-10.2


Which operator should be used to determine if a number is evenly divisible by 5?
A+
B-

C*
D % - ANSWER-%


QUESTION: A car drove 200 miles using 10 gallons of fuel.


Which operation should be used to compute the miles per gallon, which is 20?

A Addition
B Subtraction
C Multiplication
D Division - ANSWER-Division


QUESTION: A variable should hold a person's height in meters.


2

Document information

Uploaded on
January 21, 2026
Number of pages
34
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$30.49

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.
STUVIAGRADES
4.8
(1062)
Sold
6696
Followers
468
Items
10164
Last sold
3 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