




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
WGU D684 – Introduction to Computer Science Objective Assessment Exam
Typology: Exams
1 / 145
This page cannot be seen from the preview
Don't miss anything!





























































































Question 4 Which sorting algorithm has O(n²) worst-case complexity and works by repeatedly swapping adjacent elements? A) Quick Sort B) Bubble Sort C) Merge Sort D) Heap Sort Answer: B) Bubble Sort Rationale: Bubble Sort repeatedly compares and swaps adjacent elements, giving it O(n²) worst-case time complexity. Question 5 Which of the following best describes LIFO behavior? A) Queue B) Stack C) Array D) Linked list Answer: B) Stack Rationale: LIFO (Last In, First Out) means the last item added is the first removed. This is how stacks operate.
Question 6 Which SQL statement is used to add new rows to a table? A) SELECT B) UPDATE C) INSERT D) DELETE Answer: C) INSERT Rationale: INSERT adds new data rows into a table, while UPDATE modifies existing rows, DELETE removes rows, and SELECT retrieves data. Question 1 Which of the following is a volatile type of memory? A) ROM B) RAM C) Flash D) Hard disk Answer: B) RAM Rationale: RAM (Random Access Memory) loses its data when the computer is powered off, making it volatile. ROM and flash retain data without power, and hard disks are persistent storage. Question 2 What does the CPU do during the fetch-decode-execute cycle? A) Fetch data from storage, decode instructions, execute commands
Answer: C) Network Rationale: The network layer handles addressing and routing packets from source to destination across multiple networks. Question 8 What is the output of the following Python code? for i in range(3): print(i) A) 1 2 3 B) 0 1 2 C) 0 1 2 3 D) Error Answer: B) 0 1 2 Rationale: Python’s range(3) generates numbers 0, 1, 2. The loop prints each number on a new line. Question 9 Which of the following ensures that data cannot be read by unauthorized parties? A) Integrity B) Confidentiality C) Availability D) Redundancy Answer: B) Confidentiality Rationale: Confidentiality protects data from unauthorized access, forming part of the CIA triad in cybersecurity.
Question 10 What is the primary key in a database table used for? A) To allow duplicate values B) To uniquely identify each row C) To connect to other databases D) To encrypt data Answer: B) To uniquely identify each row Rationale: The primary key ensures each record is unique and can be referenced by foreign keys in other tables. Question 11 Which of the following is an example of a high- level programming language? A) Assembly B) Python C) Machine code D) Binary Answer: B) Python Rationale: High-level languages are human-readable and abstracted from hardware. Assembly and machine code are low-level. Question 12 What is the purpose of DNS in networking? A) To encrypt data B) To translate domain names into IP addresses C) To control physical devices D) To route packets
Question 15 What is the output of this Python snippet? x = 5 y = 3 print(x & y) A) 1 B) 2 C) 7 D) 8 Answer: A) 1 Rationale: Bitwise AND: 5 = 0101, 3 = 0011 → 0101 & 0011 = 0001 = 1 in decimal. Question 16 Which algorithm is most efficient for large datasets on average? A) Bubble Sort B) Merge Sort C) Insertion Sort D) Selection Sort Answer: B) Merge Sort Rationale: Merge Sort has O(n log n) complexity, making it more efficient than O(n²) algorithms for large datasets.
Question 17 Which of the following is a non-relational database type? A) MySQL B) MongoDB C) PostgreSQL D) Oracle Answer: B) MongoDB Rationale: MongoDB is document-based and non-relational. MySQL, PostgreSQL, and Oracle are relational databases. Question 18 Which device is used to connect multiple networks together? A) Switch B) Hub C) Router D) Access Point Answer: C) Router Rationale: Routers forward data packets between different networks based on IP addresses. Question 19 What is recursion in programming? A) A loop that repeats infinitely B) A function that calls itself C) A conditional statement D) A type of variable
Object-Oriented Design - ✔✔ANSW✔✔..Solves a problem with selfcontained object entities comprising data editing data and operations, focusing on how objects interact with a problem. Difference between top-down design and object-oriented design - ✔✔ANSW✔✔..The focus: Top-down design emphasizes breaking down tasks (verbs) into smaller, manageable steps, while object-oriented design emphasizes organizing and structuring the data and defining how objects interact with each other through their methods. Object-oriented programming (OOP) - ✔✔ANSW✔✔..A paradigm that organizes software design around objects that encapsulate attributable data and associated methodical behaviors, allowing developers to copy real-world concepts. Classes - ✔✔ANSW✔✔..Blueprints for creating objects within object- oriented programming to determine both the properties and behaviors that an object will have. Encapsulation - ✔✔ANSW✔✔..Grouping both data and methods within objects. Inheritance - ✔✔ANSW✔✔..Making new classes from already existing ones to inherit attributes and behaviors.
Polymorphism - ✔✔ANSW✔✔..Objects taking on many forms based on the program's given context. How OOP helps keep code neat and organized - ✔✔ANSW✔✔..By grouping together related actions alongside data. How reusing code makes it easier to build on existing work - ✔✔ANSW✔✔..Thanks to the neat organization of OOP and how it simultaneously groups related actions and data. Thinking of a class like a blueprint - ✔✔ANSW✔✔..Means that classes act like building instructions for making objects that outline the attributable properties and methodical behaviors that each object of that type will have. Class - ✔✔ANSW✔✔..A plan of what the objects will look like and what they can do, serving as a blueprint for creating objects. Object - ✔✔ANSW✔✔..An instance of the class with both class- defined OOP's problem-solving methodology - ✔✔ANSW✔✔..Produces a solution to a problem in terms of self-contained entities called objects.
Responsibility algorithms - ✔✔ANSW✔✔..The stage of writing down the responsibilities for the classes through algorithms. Car Class - ✔✔ANSW✔✔..A blueprint for creating car objects, defining fields like color, brand, model, engine size, and year, and methods like start(), stop(), and drive(). MyCar Object - ✔✔ANSW✔✔..An instance of the Car class created with specific data fields such as color = Red, brand = Jeep, model = Wrangler Rubicon, and engine size = 6.4L HEMI V engine. Properties of MyCar - ✔✔ANSW✔✔..Attributes defined in the Car class, including color, brand, model, and engine size. Behaviors of MyCar - ✔✔ANSW✔✔..Methods that the MyCar object can perform, which include start(), stop(), and drive(). Communication between Objects - ✔✔ANSW✔✔..Objects communicate with one another by sending messages, also known as invoking one
another's subprograms. Blueprint - ✔✔ANSW✔✔..A detailed plan or design that outlines the structure and behavior of objects in programming. Attributes - ✔✔ANSW✔✔..Properties or data fields that define the characteristics of an object. Methods - ✔✔ANSW✔✔..Functions defined in a class that describe the behaviors or actions that an object can perform. Inheritance - ✔✔ANSW✔✔..A mechanism in OOP that allows a class to inherit properties and methods from another class. Unique Entity - ✔✔ANSW✔✔..An object that is distinct and identifiable within the program, created from a class. Class-defined Data - ✔✔ANSW✔✔..Data that is specified and structured within a class, which objects of that class will possess.
Machine code - ✔✔ANSW✔✔..The output produced by the assembler after translating assembly language instructions. High-level languages - ✔✔ANSW✔✔..Came in two varieties: those that were compiled and those that were interpreted. Compiler - ✔✔ANSW✔✔..A compiler is a tool that translates source code written in a high-level programming language into intermediate machine language or bytecode that computers execute. Compiler program - ✔✔ANSW✔✔..A program that translates source code written in a high-level programming language into intermediate machine language or bytecode that computers execute. Multiple types of machines - ✔✔ANSW✔✔..Programs can run on many kinds of machines since compilers are programs, and there are many different types of them. Compiler output - ✔✔ANSW✔✔..Before, compilers would output assembly language for a program, but now they mainly output executable machine code. Compiled languages - ✔✔ANSW✔✔..Some examples of compiled
languages include FORTRAN, COBOL, and then ALGOL. Interpreter - ✔✔ANSW✔✔..Interpreters execute direct source code and translate it into machine code in real time instead of compiling it all from the get- go. Execution of code - ✔✔ANSW✔✔..A line of code is executed when the program reaches certain lines within an instructional top-to- bottom sequence. Interpreters as simulators - ✔✔ANSW✔✔..Interpreters can be viewed as simulators or virtual machines that understand the language in which programs are written. Interpreted languages - ✔✔ANSW✔✔..Some examples of interpreted languages include Lisp, APL, and SNOBOL4. Java introduction - ✔✔ANSW✔✔..Java was introduced in 1996. Portability - ✔✔ANSW✔✔..Portability was initially of primary importance
Imperative Paradigm - ✔✔ANSW✔✔..The imperative paradigm is based upon the von Neumann model of sequential instructions that work upon values in memory, greatly influencing the standard imperative model found within most programming languages. Characteristics of Imperative Paradigm - ✔✔ANSW✔✔..Imperative paradigms are characterized by sequential instructional execution, using variables that represent memory locations and assignment statements that change the values of these variables. Languages Supporting Imperative Paradigm - ✔✔ANSW✔✔..Imperative paradigm-supported languages include FORTRAN, BASIC, C, Pascal, and C++. Procedural Paradigm - ✔✔ANSW✔✔..Procedural paradigms are imperative models in which statements are grouped into subprograms, also known as program hierarchies, in which each performs a specific task required to solve a general program. Characteristics of Procedural Paradigm - ✔✔ANSW✔✔..Some key character traits of procedural paradigms include top-down approaches
to problem-solving, decomposing tasks into a sequence of instructions, looping, data mutation, modularizations, etc. Languages Supporting Procedural Paradigm - ✔✔ANSW✔✔..Some languages that support procedural paradigms include C, Pascal, Fortran, Ada, and then Basic. Object-Oriented Paradigm - ✔✔ANSW✔✔..Object-Oriented is based on the concept of objects. Characteristics of Object-Oriented Paradigm - ✔✔ANSW✔✔..Some characteristics of the object-oriented paradigm include data objects being active, both the objects and code manipulating them being bundled together, and the fact that the objects are all responsible for their manipulations. Languages Supporting Object-Oriented Paradigm - ✔✔ANSW✔✔..Some languages supporting object-oriented paradigms include SIMULA and Smalltalk for the old school and Java and Python for the new school. In addition, there is also the fact that C++, to some, is object-oriented, but for others, it is imperative due to some of its procedural features. analog data - ✔✔ANSW✔✔..data represented in a continuous and variable form