WGU Foundations-of-Computer-Science Exam Dumps - PDF Questions and Testing Engine [Q40-Q59]

Share

WGU Foundations-of-Computer-Science Exam Dumps - PDF Questions and Testing Engine

Latest Foundations-of-Computer-Science Exam Dumps for Pass Guaranteed

NEW QUESTION # 40
Which Python function would be used to check the data type of a variable bmi?

  • A. datatype(bmi)
  • B. type(bmi)
  • C. check(bmi)
  • D. typeof(bmi)

Answer: B

Explanation:
Python provides the built-in function `type()` to determine the data type (more precisely, the class) of an object. Because Python is dynamically typed, variable names are references to objects, and the object itself carries its type information at runtime. Calling `type(bmi)` returns a type object such as `<class 'int'>`, `<class
'float'>`, or `<class 'str'>` depending on what value is currently bound to the name `bmi`. This is the standard, textbook-approved method for checking an object's type in Python.
Option C, `typeof(bmi)`, is common in JavaScript, not Python. Options A and B are not standard Python built- ins; they might exist in user code or other languages, but not in Python's core language. In typical coursework and professional usage, `type()` is the correct function.
Textbooks also discuss how `type()` differs from `isinstance()`. While `type()` directly reports the object's class, `isinstance(bmi, float)` is often preferred when you want to allow subclass relationships. For example, in object-oriented programming, a subclass instance should often be treated as an instance of its parent class, which `isinstance` supports. However, when the question asks specifically for the function used to "check the data type," the expected answer is `type()`.
# Understanding type inspection helps with debugging, writing robust functions, and reasoning about operations that are valid for different data types.


NEW QUESTION # 41
Which Python command can be used to display the results of calculations?

  • A. result()
  • B. compute()
  • C. print()
  • D. solve()

Answer: C

Explanation:
In Python, the standard way to display output to the console is the built-in function print(). When a program performs calculations-such as arithmetic expressions, function results, or computed statistics-print() can be used to show those results to the user. For example, print(2 + 3) displays 5, and print(total / count) displays the computed average. Textbooks introduce print() early because it supports interactive learning, debugging, and communicating program behavior.
print() can display one or multiple items separated by commas, automatically converting them to string form.
It also supports formatting via f-strings (e.g., print(f"Sum = {s}")) and optional parameters like sep and end to control output formatting. This makes it versatile for reporting calculated values, intermediate steps in algorithms, and final program outputs.
The other options are not standard Python built-ins for output. compute(), result(), and solve() are not universally defined commands in Python; they might exist as user-defined functions or in specific libraries, but they are not the general command taught in textbooks for displaying results. Python follows a clear separation: expressions compute values; print() displays them.
Therefore, the correct answer is print(), as it is the primary mechanism for producing human-readable output from calculations in typical Python programs and coursework.


NEW QUESTION # 42
print(20 # 5)
What will the output be of this line?

  • A. #25
  • B. 20 + 5
  • C. no output
  • D. Syntax Error

Answer: C

Explanation:
In Python, the # character begins acomment. Everything from # to the end of the line is ignored by the interpreter and is not executed. Therefore, the line # print(20 # 5) producesno outputbecause it is a comment, not an executable statement. This is a standard concept in programming language textbooks: comments are for humans, not for the machine, and they are used to document code, explain intent, temporarily disable statements during debugging, or leave notes about assumptions and design choices.
Even though the line contains an unusual symbol #, it does not matter here, because the interpreter never tries to parse the commented text. If the # were removed, then Python would attempt to parse print(20 # 5), and since # is not a valid Python operator, that would indeed trigger a syntax error. But with the leading #, the entire line is inert.
Option A is incorrect because nothing is evaluated. Option C is incorrect because comments are not printed; they remain only in the source code. Option D is incorrect for the commented version of the line, since Python does not check comment contents for syntax. Thus, the correct result is no output.


NEW QUESTION # 43
What is another term for the inputs into a function?

  • A. Outputs
  • B. Variables
  • C. Arguments
  • D. Procedures

Answer: C


NEW QUESTION # 44
What is the time complexity of a binary search algorithm?

  • A. O(n^2)
  • B. O(2^n)
  • C. O(log n)
  • D. O(n)

Answer: C

Explanation:
Binary search is a classic algorithm for finding a target value in asortedlist or array. Its key idea is to eliminate half of the remaining search space at each step. The algorithm compares the target with the middle element. If the target is smaller, it continues searching in the left half; if larger, it searches the right half.
Because each comparison reduces the problem size from n to approximately n/2, the number of steps grows with the number of times you can halve n before reaching 1 element.
This repeated halving leads to a logarithmic running time. Formally, the recurrence is often written as T(n) = T (n/2) + O(1), which solves to T(n) = O(log n). (GeeksforGeeks) Textbooks emphasize that this is dramatically faster than linear search (O(n)) for large datasets, but only when the data is already sorted (or can be sorted once and searched many times).
The other options do not match binary search behavior: O(n^2) is typical of certain nested-loop algorithms, and O(2^n) is associated with exponential-time brute force in combinatorial problems.
Binary search's hallmark is its logarithmic growth in comparisons, making it a foundational technique in algorithms courses. (GeeksforGeeks)


NEW QUESTION # 45
Which brand of Type 1 hypervisor is commonly used to create virtual machines?

  • A. VMware ESXi
  • B. VirtualBox
  • C. Parallels Desktop
  • D. VMware Workstation

Answer: A

Explanation:
AType 1 hypervisor, also called abare-metal hypervisor, runs directly on the host machine's hardware rather than on top of a general-purpose operating system. This design is widely described in virtualization textbooks because it improves performance and isolation: the hypervisor controls CPU scheduling, memory management, and I/O virtualization with minimal overhead from an intermediate OS layer. Type 1 hypervisors are therefore common in servers and data centers.
Among the options,VMware ESXiis the well-known Type 1 hypervisor product. It is installed directly onto physical server hardware and provides the virtualization layer used to run multiple virtual machines. In contrast, Parallels Desktop, VirtualBox, and VMware Workstation are typically categorized asType 2 hypervisors, meaning they run as applications on top of a host operating system like Windows, macOS, or Linux. Type 2 hypervisors are excellent for desktops, development, testing, and learning, but they generally rely on the host OS for device drivers and resource management, which can add overhead.
This distinction matters in practice: data centers favor Type 1 hypervisors for efficiency, centralized management, and robust isolation between workloads. Desktop users often choose Type 2 hypervisors for convenience and easier installation. Therefore, the commonly used Type 1 hypervisor brand listed here is VMware ESXi.


NEW QUESTION # 46
What is the purpose of the pointer element of each node in a linked list?

  • A. To indicate the current position
  • B. To keep track of the list size
  • C. To store the data value
  • D. To indicate the next node

Answer: D

Explanation:
In a singly linked list, each node is a small record that typically contains two main parts: a data field and a pointer field. The data field stores the actual value being kept in the list. The pointer field stores the address or reference of another node. The pointer element's purpose is to connect one node to the next by indicating where the next node is located in memory. This is essential because linked-list nodes are not stored in contiguous memory locations the way array elements are. Nodes may exist anywhere in memory, and the pointer is what preserves the logical sequence of the list.
This design supports efficient structural changes. For traversal, a program starts at the head node and repeatedly follows the pointer to reach subsequent nodes. For insertion, a new node can be added by adjusting a small number of pointers instead of shifting many elements, as would be required in an array. For deletion, the list can "skip over" a node by updating the pointer in the previous node to reference the node after the removed one. The end of the list is typically represented by a null pointer value, signaling there is no next node.
Keeping track of list size or current position is not the responsibility of each node's pointer field; these are usually handled by separate variables or computed during traversal.


NEW QUESTION # 47
What is the component of the operating system that manages core system resources but allows no user access?

  • A. User interface layer
  • B. Device driver manager
  • C. The File Explorer
  • D. The kernel

Answer: D

Explanation:
Thekernelis the central component of an operating system responsible for managing core system resources. It controls CPU scheduling, memory management, process creation and termination, device I/O coordination, and system calls-the controlled interface through which user programs request services. In operating systems textbooks, the kernel is described as running in a privileged mode (often called kernel mode or supervisor mode), which restricts direct user access for security and stability. User programs typically run in user mode and cannot directly manipulate hardware or critical OS structures; instead, they must request operations via system calls, which the kernel validates and executes.
This separation prevents accidental or malicious actions from crashing the entire system or compromising other processes. For example, a user application cannot directly write to arbitrary memory addresses or reprogram devices; the kernel mediates access and enforces protection boundaries. This model is foundational to modern OS design and underpins features like virtual memory, access control, and multitasking.
File Explorer and the user interface layer are user-facing components that provide interaction and file browsing; they are not the privileged core resource manager. "Device driver manager" is not typically the name of a single OS component; while drivers and driver subsystems exist, they operate under kernel control and are part of the kernel or closely integrated with it.
Therefore, the OS component that manages core resources while disallowing direct user access is the kernel.


NEW QUESTION # 48
What is a key advantage of using NumPy when handling large datasets?

  • A. Efficient storage and computation
  • B. Automatic data cleaning
  • C. Interactive visualizations
  • D. Built-in machine learning algorithms

Answer: A

Explanation:
NumPy's key advantage for large datasets isefficient storage and fast computation. Unlike Python lists, which store references to objects and can have per-element overhead, NumPy arrays store data in a compact, homogeneous format (single dtype) in contiguous or strided memory. This reduces memory usage and improves cache locality, which is crucial for performance on large arrays. Additionally, NumPy operations are vectorized: many computations run in optimized compiled code rather than interpreted Python loops. This enables large speedups for arithmetic, linear algebra, statistics, and transformations over entire arrays.
Option A is incorrect because NumPy itself does not provide full machine learning algorithms; those are typically found in libraries like scikit-learn, though they build on NumPy. Option B is incorrect because NumPy does not automatically clean data; data cleaning is usually done with pandas or custom logic. Option D is incorrect because interactive visualizations are typically handled by libraries like matplotlib, seaborn, or plotly, not by NumPy.
Textbooks in scientific computing highlight that NumPy forms the computational foundation of the Python data ecosystem. Its array model supports broadcasting, slicing, and efficient aggregations, all of which are essential when working with millions of numeric values. By combining compact memory layout with compiled numerical kernels, NumPy enables scalable analysis and simulation workloads that would be slow or memory-heavy using pure Python lists.


NEW QUESTION # 49
What is the alternative way to access the third element of the first row in np_2d?

  • A. np_2d[2, 0]
  • B. np_2d[1, 3]
  • C. np_2d[3, 1]
  • D. np_2d[0, 2]

Answer: D

Explanation:
NumPy arrays use zero-based indexing, meaning counting starts at 0 rather than 1. In a 2D NumPy array, indexing is typically written in the form array[row_index, column_index]. The first index selects the row, and the second index selects the column. Therefore, the "first row" corresponds to row index 0. Within that row, the "third element" corresponds to column index 2, because the columns are indexed 0, 1, 2, 3, and so on.
So, np_2d[0, 2] directly selects the element at row 0 and column 2, which is the third element in the first row.
This is considered an "alternative" to approaches like two-step indexing (np_2d[0][2]), and it is the standard idiom taught for multi-dimensional NumPy arrays.
The other choices point to different locations. np_2d[1, 3] is the fourth element of the second row, not the third element of the first row. np_2d[2, 0] and np_2d[3, 1] attempt to access the third or fourth row, which would often be out of bounds in a small 2-row example and would raise an IndexError. Correct indexing is a cornerstone of array programming because it determines which observation, feature, or matrix entry your computations will use.


NEW QUESTION # 50
What is the only content that will display if the List folder contents permission is not enabled for a particular folder in Windows 11?

  • A. Files with Write permission
  • B. The folder's creation date
  • C. Files with Read permission
  • D. The folder's author

Answer: B

Explanation:
In Windows file security (NTFS permissions), "List folder contents" controls whether a user cansee the names of files and subfoldersinside a folder. If a user does not have permission to list a folder, Windows prevents directory enumeration: the user cannot browse the folder and view what is inside. (2BrightSparks) This is a key concept in access control: it separates "being able to traverse to a location" from "being able to see what is stored there." When "List folder contents" is not enabled, the user typically cannot view the list of files regardless of whether individual files might have separate permissions. In standard user-facing behavior, what remains visible in the folder's properties and metadata is limited; among the choices given, the only item that is reliably a folder-level metadata attribute (and not a listing of contents) is the folder'screation date. The
"author" is not a universal, reliably displayed NTFS folder property, and options C and D talk about files (contents), which cannot be listed without the list permission. (2BrightSparks) This reflects a broader textbook principle: operating systems enforce access control both on objects (files/folders) and on operations (read data, write data, list directory). Removing the list operation blocks visibility of contents, even if other permissions exist elsewhere.


NEW QUESTION # 51
What is the name of the tool that can allow a device to run more than one operating system at a time as virtual machines?

  • A. Bootloader
  • B. System Restore
  • C. Hypervisor
  • D. Partition Manager

Answer: C

Explanation:
Ahypervisoris the software layer that enables virtualization-running multiple operating systems concurrently on the same physical hardware as separate, isolated virtual machines (VMs). Operating systems textbooks describe the hypervisor as managing and multiplexing core hardware resources such as CPU, memory, storage, and I/O devices among multiple guest operating systems. Each VM behaves as if it has its own hardware, while the hypervisor enforces isolation and schedules resource usage.
Hypervisors come in two broad categories.Type 1 (bare-metal)hypervisors run directly on the hardware (common in data centers), whileType 2 (hosted)hypervisors run as applications on top of a host OS (common on desktops). In both cases, the hypervisor is the key tool that makes "more than one OS at a time" possible.
System Restore is a recovery feature, not a virtualization platform. A partition manager can split a disk into multiple partitions, which can support dual-boot setups, but that runs only one OS at a time, not concurrently as VMs. A bootloader selects which OS to start at boot time; again, that is not simultaneous virtualization. Therefore, the correct tool that allows running multiple operating systems simultaneously as virtual machines is the hypervisor.


NEW QUESTION # 52
How can someone subset the last two rows and columns of a 2D NumPy array?

  • A. array[-2:, -2:]
  • B. array[-1:, -1:]
  • C. array[:, -2:]
  • D. array[-2:, :]

Answer: A

Explanation:
NumPy slicing uses the same start/stop rules as Python sequences, and it also supports negative indices to count from the end. In a 2D array, slicing is written as array[rows, columns]. To get thelast two rows, you use
-2: in the row position, meaning "start two rows from the end and go to the end." Similarly, to get thelast two columns, you use -2: in the column position. Combining these gives array[-2:, -2:], which selects the bottom- right 2×2 subarray.
Option A, array[-2:, :], selects the last two rows butall columns, so it is not restricted to the last two columns.
Option D, array[:, -2:], selects all rows but only the last two columns. Option B, array[-1:, -1:], selects only the last row and the last column, producing a 1×1 (or 1×1 view) subarray, not a 2×2.
This kind of slicing is widely taught because it is essential for matrix operations, extracting submatrices, working with sliding windows, and manipulating image or time-series data where "take the last k observations/features" is common. Negative indexing reduces errors and makes code clearer, especially compared with computing explicit indices like array[rows-2:rows, cols-2:cols].


NEW QUESTION # 53
Which type of sorting algorithm starts at the first position and moves the pointer until the end of the list, determining the lowest value?

  • A. Selection sort
  • B. Pointer sort
  • C. Progressive sort
  • D. Incremental sort

Answer: A

Explanation:
Selection sort is the algorithm that repeatedly scans the unsorted portion of a list to find the lowest (or highest) value and then places it into its correct position in the sorted portion. It begins at the first index (position 0) and treats that as the boundary between sorted and unsorted regions. On the first pass, it moves a scanning pointer through the entire list to determine the minimum element and swaps it into position 0. On the second pass, it starts from position 1, scans to the end to find the next minimum, and swaps it into position 1.
This continues until the list is sorted.
This matches the question's description: "starts at the first position and moves the pointer until the end of the list, determining the lowest value." Textbooks often describe selection sort with two indices: one for the current boundary position and one for scanning the remainder of the list to find the minimum. The algorithm is simple and uses O(1) extra space, but it is inefficient for large lists because it performs O(n²) comparisons regardless of input order.
The other options are not standard algorithm names in typical computer science curricula. While many sorting algorithms exist (insertion sort, merge sort, quicksort, heap sort), "incremental," "progressive," and "pointer sort" are not canonical textbook algorithms in this context. Therefore, the correct answer is selection sort.


NEW QUESTION # 54
Which aspect of a security policy would define the ramifications of abusing company resources?

  • A. Acceptable Use Policy
  • B. Network Security Policy
  • C. Data Retention Policy
  • D. Physical Security Policy

Answer: A

Explanation:
AnAcceptable Use Policy (AUP)defines how employees and users are permitted to use an organization's computing resources-such as email, internet access, file storage, endpoints, and networks-and it typically specifies prohibited behaviors and the consequences of violations. In security and IT governance textbooks, the AUP is framed as both a behavioral contract and a risk-management tool: it reduces misuse, clarifies expectations, and provides an enforceable basis for disciplinary action.
The "ramifications of abusing company resources" (for example, installing unauthorized software, excessive personal use, accessing inappropriate content, attempting to bypass security controls, or sharing credentials) are precisely the kinds of issues an AUP addresses. The policy often includes monitoring statements (users have limited expectation of privacy), compliance requirements, and escalation paths for violations.
A Network Security Policy (A) focuses on technical rules for network protection-firewalls, segmentation, remote access, and intrusion detection-rather than broad user conduct and disciplinary consequences. A Physical Security Policy (B) addresses protection of facilities and hardware-badges, locks, visitor procedures, secure areas. A Data Retention Policy (D) defines how long data is stored, how it is archived, and how it is disposed, which is different from defining misuse consequences.
Thus, the policy aspect that defines permissible behavior and the consequences for abusing resources is the Acceptable Use Policy.


NEW QUESTION # 55
What is the output of print(employees[3]) when employees = ["Anika", "Omar", "Li", "Alex"]?

  • A. "Alex"
  • B. "Omar"
  • C. "Li"
  • D. "Anika"

Answer: A

Explanation:
Python lists are ordered sequences indexed starting from 0. This zero-based indexing is standard in many programming languages and is a core concept in data structures. For the list `employees = ["Anika", "Omar",
"Li", "Alex"]`, the mapping of indices to elements is: index 0 # "Anika", index 1 # "Omar", index 2 # "Li", index 3 # "Alex". Therefore, the expression `employees[3]` selects the element at index 3, which is `"Alex"`, and `print(employees[3])` outputs `Alex` (strings print without quotes in normal output).
Option A would be correct for `employees[1]`, option D would be correct for `employees[2]`, and option C would be correct for `employees[0]`. This kind of question tests understanding of list indexing, which is essential for iteration, slicing, and algorithm implementation.
# Textbooks also note the difference between indexing and slicing: indexing returns a single element, while slicing returns a sublist. Here, because square brackets contain a single integer index, it is indexing. If you attempted an index that is out of range, Python would raise an `IndexError`, which reinforces careful reasoning about list length and positions. Understanding these fundamentals is critical for correctly manipulating datasets, where row/column positions and offsets frequently matter.


NEW QUESTION # 56
Which protocol provides encryption while email messages are in transit?

  • A. IMAP
  • B. FTP
  • C. HTTP
  • D. TLS

Answer: D

Explanation:
"Encryption in transit" means protecting data while it moves across a network so that eavesdroppers cannot read or modify it. For email systems, this protection is most commonly provided byTLS (Transport Layer Security). TLS is a cryptographic protocol that can wrap application protocols (including mail protocols) to provide confidentiality, integrity, and server (and sometimes client) authentication. In practice, TLS is used to secure connections such as SMTP submission (often with STARTTLS or implicit TLS), IMAP over TLS, and POP3 over TLS. Textbooks present TLS as the standard successor to SSL and the foundation of secure communication on the modern Internet.
The other options are not correct in this context. FTP is a file transfer protocol and is traditionally unencrypted unless paired with additional security mechanisms (e.g., FTPS, which uses TLS, or SFTP, which uses SSH). HTTP is a web protocol; it becomes encrypted only when used as HTTPS, which again relies on TLS underneath. IMAP is an email retrieval protocol, butIMAP itself is not the encryption protocol- IMAP can be run over TLS (IMAPS) to become secure.
Therefore, the protocol that provides encryption while email messages (or email protocol traffic) are in transit is TLS.


NEW QUESTION # 57
Which type of files are meant to be inaccessible to standard users, but can be critical in terms of functionality?

  • A. System files
  • B. Extension files
  • C. Backup files
  • D. Log files

Answer: A

Explanation:
Operating systems contain many files that are essential for booting, hardware support, security enforcement, and core services. These are generally referred to assystem files. Textbooks explain that system files are often protected by permissions and special attributes because accidental modification or deletion could destabilize the OS, break device drivers, prevent applications from running, or even stop the machine from booting.
Therefore, standard (non-administrator) users are typically restricted from accessing or altering them, and the OS may hide them by default to reduce the risk of user error.
Examples include kernel-related components, shared libraries, driver files, configuration databases, and critical service executables. Modern OS designs enforce protection through user accounts, access control lists, and privilege separation. This ensures only trusted processes and administrators can change system-critical components.
Log files record events and are sometimes protected, but many logs are readable by users or administrators depending on policy; they are not necessarily "meant to be inaccessible" in the same strict sense. Backup files are important for recovery but are not inherently system-critical for day-to-day operation, and their accessibility depends on organizational policy. "Extension files" is not a standard category; file extensions describe formats rather than a protected functional class.
Thus, the files intended to be inaccessible to standard users yet critical for functionality are system files, reflecting core OS security principles such as least privilege and integrity protection.


NEW QUESTION # 58
Which statement describes the data type restriction found in most NumPy arrays?

  • A. NumPy arrays must be of the same type of data.
  • B. NumPy arrays are restricted to string data types only.
  • C. NumPy arrays can only hold integer data types.
  • D. NumPy arrays adapt to the most complex data type on the fly.

Answer: A

Explanation:
Most NumPy arrays enforce a key constraint: all elements share the samedtype(data type). This uniform typing is foundational to NumPy's performance model. Because each element has the same size and representation, NumPy can store the array in a contiguous memory block and apply low-level, vectorized operations efficiently. This is why NumPy is widely used for numerical computing, statistics, and data analysis: operations like addition, multiplication, and reductions (sum/mean) can be implemented in optimized compiled code without per-element Python overhead.
Option B captures this textbook principle: elements in a typical ndarray are of the same data type. The other options are incorrect. NumPy is not restricted to strings (A), and it is not limited to integers (C); it supports floats, complex numbers, booleans, fixed-width strings, datetime types, and many others. Option D is misleading: NumPy does not continuously "adapt on the fly" during normal use. The dtype is generally fixed once the array exists. What NumPydoesdo is choose an appropriate common dtype when you create an array from mixed inputs (for example, mixing ints and floats yields floats). But after creation, assignments are cast into the existing dtype rather than dynamically changing the dtype to accommodate new values.
This restriction is precisely what differentiates NumPy arrays from Python lists and enables predictable memory layout and fast numerical computation.


NEW QUESTION # 59
......

Reliable Courses and Certificates Foundations-of-Computer-Science Dumps PDF Jun 09, 2026 Recently Updated Questions: https://www.actual4labs.com/WGU/Foundations-of-Computer-Science-actual-exam-dumps.html

Pass Your WGU Foundations-of-Computer-Science Exam with Correct 72 Questions and Answers: https://drive.google.com/open?id=14m0IM_La9RgJFFoxIG2-SYx0aJEpCI_s

Contact Us

If you have any question please leave me your email address, we will reply and send email to you in 12 hours.

Our Working Time: ( GMT 0:00-15:00 )
From Monday to Saturday

Support: Contact now