• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 4 fuera de 60 páginas
Examen

WGU Scripting and Programming Foundations (C173/D278) – The Ultimate Practice Exam

Document preview thumbnail
Vista previa 4 fuera de 60 páginas

WGU Scripting and Programming Foundations (C173/D278) – The Ultimate Practice Exam

Vista previa del contenido

WGU Scripting and Programming Foundations
(C173/D278) – The Ultimate Practice Exam

Section 1: Programming Fundamentals & Data Types
Question 5
Which of the following is an example of a primitive data type?
• A) Array
• B) String
• C) Integer
• D) Object
Answer: C) Integer
Explanation: Primitive data types are the most basic data types built into a
programming language. Integers represent whole numbers and are considered
primitive in most languages. Arrays, Strings, and Objects are typically composite
or reference data types that are built from primitive types.


Question 6
What is the value of the variable result after the following operation? result = 17 %
5
• A) 3
• B) 2
• C) 3.4
• D) 12
Answer: B) 2

,Explanation: The modulus operator (%) returns the remainder after division. 17
divided by 5 equals 3 with a remainder of 2, so the result is 2. This is a common
operator used to check divisibility or to wrap values within a range.


Question 7
Which naming convention is considered best practice for variable names in most
programming languages?
• A) Using single letters like x, y, z
• B) Using descriptive names that indicate purpose
• C) Using numbers at the beginning of names
• D) Using all capital letters for all variables
Answer: B) Using descriptive names that indicate purpose
Explanation: Using descriptive variable names improves code readability and
maintainability. Names like studentGPA or totalSales clearly communicate what
data the variable holds, making the code self-documenting and easier for others to
understand.


Question 8
What is the correct ordering of data types from smallest to largest memory
footprint (assuming 32-bit system)?
• A) char < int < float < double
• B) int < char < float < double
• C) char < float < int < double
• D) float < char < int < double
Answer: A) char < int < float < double
Explanation: On most 32-bit systems, a char typically uses 1 byte, an int uses 4
bytes, a float uses 4 bytes, and a double uses 8 bytes. While int and float both use 4
bytes, the ordering in typical memory hierarchy places char first, then int and float,
then double.

,Question 9
Which of the following is a valid variable declaration in most programming
languages?
• A) 2ndPlace = "Silver"
• B) final-score = 95
• C) _totalAmount = 100.50
• D) class = "Computer Science"
Answer: C) _totalAmount = 100.50
Explanation: Variable names typically must start with a letter or underscore, not a
number. They cannot contain special characters like hyphens (which are
interpreted as subtraction operators). While "class" might be syntactically valid in
some languages, it is often a reserved keyword and should be avoided. The
underscore at the beginning of _totalAmount is acceptable in most languages.


Question 10
What is the primary purpose of using constants in programming?
• A) To store data that changes frequently
• B) To create dynamic arrays
• C) To store values that should not change during program execution
• D) To allow user input collection
Answer: C) To store values that should not change during program execution
Explanation: Constants are used to store values that remain fixed throughout
program execution, such as mathematical constants (PI), configuration settings, or
fixed conversion factors. Using constants prevents accidental modification and
improves code readability by giving meaningful names to fixed values.


Question 11

, What is the difference between a compiler and an interpreter?
• A) A compiler executes code line-by-line, while an interpreter translates the
entire program first
• B) A compiler translates the entire program at once, while an interpreter
executes code line-by-line
• C) Compilers are only used for web development
• D) There is no significant difference
Answer: B) A compiler translates the entire program at once, while an
interpreter executes code line-by-line
Explanation: A compiler processes the entire source code, translating it into
machine code before execution, creating an executable file. An interpreter
translates and executes the code line-by-line during runtime, without creating a
separate executable. Compiled programs typically run faster, while interpreted
programs offer more flexibility and easier debugging.


Question 12
Which of the following correctly identifies a Boolean data type?
• A) A data type that stores decimal numbers
• B) A data type that represents true or false values
• C) A data type that stores a single character
• D) A data type that stores text strings
Answer: B) A data type that represents true or false values
Explanation: Boolean data types represent logical values, typically true or false.
They are fundamental for conditional statements and logical operations in
programming. They are named after George Boole, who developed the algebra of
logic.


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

Información del documento

Subido en
3 de agosto de 2026
Número de páginas
60
Escrito en
2026/2027
Tipo
Examen
Contiene
Preguntas y respuestas
$27.99

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
Vendido
41
Seguidores
0
Artículos
4036
Última venta
2 días hace



Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes