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

WGU D278 Pre-Assessment Exam Scripting and Programming – Foundations 2026/2027 | Complete Practice Questions and Answers

Document preview thumbnail
Preview 4 out of 42 pages

WGU D278 Pre-Assessment Exam Scripting and Programming – Foundations 2026/2027 | Complete Practice Questions and Answers Description: This comprehensive revision guide contains 200 multiple-choice questions covering all key domains of the WGU D278 Scripting and Programming – Foundations course. Topics include variables, data types, operators, control structures, loops, functions, arrays, strings, file I/O, object-oriented programming, algorithms, debugging, and scripting fundamentals. Each question includes the correct answer marked with for effective self-assessment and exam preparation. Keywords: WGU D278, Scripting and Programming Foundations, Pre-Assessment, MCQ, Practice Questions, Programming Fundamentals, Algorithms, Data Types, Control Structures, Functions, Arrays, OOP, Debugging, 2026, 2027. 1. Which of the following best defines a variable in programming? A) A fixed value that cannot be changed B) A named storage location in memory that can hold a value C) A type of loop D) A function that returns a value 2. What is the primary purpose of a data type in programming? A) To define the color of text B) To specify the kind of data a variable can hold and the operations that can be performed on it C) To increase the speed of the program D) To create graphical user interfaces 3. Which data type is used to store a single character? A) String B) Integer C) Char D) Boolean 4. What is the value of a Boolean variable? A) Any number B) True or False C) A single letter D) A decimal number 5. Which of the following is an example of a floating-point data type? A) 42 B) "Hello" C) 3.14 D) True 6. What is the result of the expression 7 % 3? A) 2 B) 1 C) 2.33 D) 0 7. Which operator is used for exponentiation in many programming languages? A) ^ B) ** C) // D) %% 8. What is the purpose of the assignment operator (=)? A) To compare two values B) To assign a value to a variable C) To add two numbers D) To declare a function 9. Which of the following is a logical operator? A) + B) && C) = D) % 10. What does the expression (5 3) && (2 4) evaluate to? A) True B) False C) 5 D) 2 11. What is the output of the following code? int x = 5; x += 3; print(x); A) 5 B) 3 C) 8 D) 2 12. Which control structure is used to execute a block of code repeatedly based on a condition? A) If statement B) Loop C) Function D) Array 13. What is the correct syntax for an if statement in most languages?

Content preview

WGU D278 Pre-Assessment Exam
Scripting and Programming –
Foundations 2026/2027 | Complete
Practice Questions and Answers
Description: This comprehensive revision guide contains 200 multiple-choice questions
covering all key domains of the WGU D278 Scripting and Programming – Foundations
course. Topics include variables, data types, operators, control structures, loops,
functions, arrays, strings, file I/O, object-oriented programming, algorithms,
debugging, and scripting fundamentals. Each question includes the correct answer
marked with ✅ for effective self-assessment and exam preparation.

Keywords: WGU D278, Scripting and Programming Foundations, Pre-Assessment, MCQ,
Practice Questions, Programming Fundamentals, Algorithms, Data Types, Control
Structures, Functions, Arrays, OOP, Debugging, 2026, 2027.




1. Which of the following best defines a variable in programming?

A) A fixed value that cannot be changed
B) A named storage location in memory that can hold a value ✅
C) A type of loop
D) A function that returns a value

,2. What is the primary purpose of a data type in programming?

A) To define the color of text
B) To specify the kind of data a variable can hold and the operations that can be
performed on it ✅
C) To increase the speed of the program
D) To create graphical user interfaces

3. Which data type is used to store a single character?

A) String
B) Integer
C) Char ✅
D) Boolean

4. What is the value of a Boolean variable?

A) Any number
B) True or False ✅
C) A single letter
D) A decimal number

5. Which of the following is an example of a floating-point data type?

A) 42
B) "Hello"
C) 3.14 ✅
D) True

6. What is the result of the expression 7 % 3?

A) 2
B) 1 ✅

,C) 2.33
D) 0

7. Which operator is used for exponentiation in many programming languages?

A) ^
B) ** ✅
C) //
D) %%

8. What is the purpose of the assignment operator (=)?

A) To compare two values
B) To assign a value to a variable ✅
C) To add two numbers
D) To declare a function

9. Which of the following is a logical operator?

A) +
B) && ✅
C) =
D) %

10. What does the expression (5 > 3) && (2 < 4) evaluate to?

A) True ✅
B) False
C) 5
D) 2

11. What is the output of the following code? int x = 5; x += 3; print(x);

A) 5
B) 3

, C) 8 ✅
D) 2

12. Which control structure is used to execute a block of code repeatedly based on
a condition?

A) If statement
B) Loop ✅
C) Function
D) Array

13. What is the correct syntax for an if statement in most languages?

A) if (condition) { } ✅
B) if condition then { }
C) if { condition }
D) if: condition

14. Which loop is guaranteed to execute at least once?

A) For loop
B) While loop
C) Do-while loop ✅
D) Foreach loop

15. What is the purpose of a break statement in a loop?

A) To continue to the next iteration
B) To exit the loop immediately ✅
C) To restart the loop
D) To pause the loop

16. What does the continue statement do in a loop?

Document information

Uploaded on
September 18, 2026
Number of pages
42
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$11.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

Sold
7
Followers
0
Items
957
Last sold
1 week 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