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

WGU D278 SCRIPTING AND PROGRAMMING FOUNDATIONS EXAM QUESTIONS AND ANSWERS

Rating
-
Sold
-
Pages
151
Grade
A+
Uploaded on
30-06-2026
Written in
2025/2026

WGU D278 SCRIPTING AND PROGRAMMING FOUNDATIONS EXAM QUESTIONS AND ANSWERS

Content preview

WGU D278 SCRIPTING AND PROGRAMMING FOUNDATIONS EXAM QUESTIONS
AND ANSWERS 2026 .

WGU D278 Scripting and Programming Foundations - 200 Practice Questions

Question 1

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: D



Rationale: Division is used to compute miles per gallon by dividing the distance
traveled (200 miles) by the fuel used (10 gallons), resulting in 20 mpg. This is a
rate calculation where the total distance is divided by the total fuel consumed .



Question 2

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

,A. +

B. -

C. *

D. %



Answer: D



Rationale: The modulus operator (%) returns the remainder after division. If a
number modulo 5 equals 0, the number is evenly divisible by 5. This is commonly
used in programming for checking divisibility and in loop conditions .



Question 3

A variable should hold a person's height in meters. Which data type should the
variable be?



A. Integer

B. Float

C. String

D. Boolean

,Answer: B



Rationale: Float (floating-point) data types store numbers with decimal points.
Height in meters typically requires decimal precision (e.g., 1.75 meters). Integers
only store whole numbers and would lose precision .



Question 4

A variable should hold the names of all past U.S. presidents. Which data type
should the variable be?



A. Integer array

B. Float array

C. String array

D. Boolean array



Answer: C

, Rationale: Names are text data, which should be stored as strings. Since multiple
names are needed, an array of strings is appropriate. This allows storing and
accessing multiple text values efficiently .



Question 5

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: C



Rationale: The number of seconds in a minute (60) is a fixed, unchanging value. It
should be declared as a constant integer. Constants improve code readability and
prevent accidental modification of values that should remain fixed .



Question 6

Document information

Uploaded on
June 30, 2026
Number of pages
151
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$29.99
Get access to the full document:

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

Get to know the seller
Seller avatar
supergrader
5.0
(2)

Get to know the seller

Seller avatar
supergrader Teachme2-tutor
View profile
Follow You need to be logged in order to follow users or courses
Sold
6
Member since
11 months
Number of followers
0
Documents
2157
Last sold
3 weeks ago
supergrade

Welcome to supergrade Stuvia shop! We offer a wide range of high-quality study materials, including Test Banks, Study Guides, and comprehensive notes for various courses. If you’re looking for specific materials, feel free to send me a message here on Stuvia, and I’ll help you find exactly what you need. Study smarter and achieve your best results

5.0

2 reviews

5
2
4
0
3
0
2
0
1
0

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