Software Development Flashcards
Objective 4 (41 cards)
A programmer needs an element that will automatically store customer orders consecutively by order number every time a new order is placed. Which of the following elements should be used?
A. Vector
B. Sequence
C. Array
D. Constant
B. Sequence
A sequence is a data structure that automatically maintains the order of elements in which they were added or inserted. In the context of the programmer’s requirement to store customer orders consecutively by order number every time a new order is placed, a sequence would be the most appropriate choice.
A programmer is generating results by iterating rows that provide values needed for one calculation. Which of the following functions best accomplishes this task?
A. Branching
B. Pausing for input
C. Sorting
D. Looping
D. Looping
Looping is a programming construct that allows a programmer to execute a block of code repeatedly based on a condition or for a specific number of iterations. In this scenario, where a programmer needs to iterate through rows to perform calculations, looping would be the most appropriate function. The programmer can use loop statements such as “for” loops or “while” loops to iterate over the rows of data and perform the necessary calculations.
A programming construct that is most beneficial for organizing a program’s data and behavior is:
A. an object.
B. a licensing agreement.
C. a query.
D. a constant.
A. An Object.
organizing data and behavior
An object is a programming construct that encapsulates both data (attributes or properties) and behavior (methods or functions) into a single entity. This concept is fundamental to object-oriented programming (OOP) paradigms, where objects represent real-world entities or abstract concepts. Objects allow for the organization of a program’s data and behavior into modular, reusable components, promoting code organization, maintainability, and scalability.
Which of the following programming concepts uses properties and attributes?
A. Objects
B. Functions
C. Containers
D. Identifiers
A. Objects
In programming, objects are instances of classes or data structures that encapsulate data (properties) and behavior (methods or functions). Properties represent the characteristics or attributes of an object, while methods represent the actions or behaviors that the object can perform. For example, in object-oriented programming languages like Java or Python, you can define a class called “Car” with properties such as “color,” “make,” and “model,” and methods such as “drive” and “stop.” Objects created from this class would have specific values assigned to their properties and could perform actions using their methods.
Given the following lines: This is an example of:
If child 1 is fed AND child 2 is fed
Echo “dinner is complete!” and set spouse to satisfied
Else echo “Please feed the kids!”
A. a flowchart.
B. looping.
C. an assembly.
D. pseudocode.
D. Pseudocode
Pseudocode is a high-level description of a computer program or algorithm that uses natural language and structured formatting to outline the logic and steps of the program without adhering to the syntax of a specific programming language. Pseudocode is often used as an intermediate step in program development to plan and design algorithms before implementing them in code. The given lines represent a logical condition (If-Else statement) written in pseudocode to describe a scenario where dinner is considered complete if both child 1 and child 2 are fed, and the spouse is then set to satisfied. If either child 1 or child 2 is not fed, a message is echoed indicating that the kids need to be fed.
Which of the following is an example of a compiled language?
A. C++
B. SQL
C. Python
D. XML
A. C++
Python, XML = interpreted, SQL = database language
A compiled language is a programming language whose source code is translated into machine code (binary code) before execution. C++ is a compiled language where the source code is compiled into executable machine code, which can then be directly executed by the computer’s hardware.
Which of the following data types should a database administrator use to store customer postal codes?
A. Float
B. String
C. Boolean
D. Integer
B. String
Postal codes typically contain alphanumeric characters and may include special characters like hyphens or spaces. Therefore, using a string data type (also known as VARCHAR or CHAR) allows for the storage of variable-length character sequences, making it suitable for storing postal codes of varying formats and lengths.
Given this example:
FEB8077911AB12TB -
Which of the following is being represented?
A. MAC address
B. String
C. Hexadecimal
D. Unicode
B. String
In computer programming, a string is a sequence of characters, which can include letters, numbers, and special symbols. The example provided (“FEB8077911AB12TB”) is a sequence of characters, resembling a string of alphanumeric characters. It does not appear to follow any specific encoding or representation pattern such as hexadecimal or Unicode. Hence, the most suitable classification for this example is as a string.
a.MAC Addresses use Hexidecimal (0-9, A-F)
c.Hexadecimal is a notational system 0-9 and A-F
d. Is the standard for all the languages, universal code.
Which of the following scripting languages is most likely to be used in a Linux command-line environment?
A. JavaScript
B. PowerShell
C. C++
D. Bash
D. Bash
JavaScript, PowerShell = types of interpreted, C++ = compiled
Bash (Bourne Again Shell) is a command language interpreter for Unix and Linux operating systems. It is the default shell for most Linux distributions and provides a powerful scripting environment for automating tasks, managing system configurations, and executing commands. Bash scripts, written in the Bash scripting language, are commonly used to create automated workflows, system administration tasks, and custom utilities within the Linux command-line environment.
Which of the following language types is MOST likely used to retrieve data from a database?
A. Query language
B. Scripted language
C. Assembly language
D. Compiled language
A. Query Language
A query language, such as SQL (Structured Query Language), is specifically designed for retrieving data from databases. SQL allows users to interact with databases by querying and manipulating data, retrieving specific information based on criteria specified in the query.
Which of the following shows how many results are possible when evaluating Boolean data types?
A. Two
B. Four
C. Three
D. Five
A. Two
Boolean data types can represent only two possible values: true or false. Therefore, when evaluating Boolean data types, there are two possible results: true or false.
Which of the following is the exact number of bytes in a gigabyte?
A. 1,024 bytes
B. 1,048,576 bytes
C. 1,073,741,824 bytes
D. 1,099,511,627,776 bytes
C. 1,073,741,824 bytes
0 comma = B
1 comma = KB
2 commas = MB
3 commas = GB
4 commas = TB
A gigabyte (GB) is equal to 1,073,741,824 bytes. This is the binary definition of a gigabyte, based on the binary prefix “giga” which represents 2^30 bytes.
A programmer wants to use a programming language in which high performance is a requirement. Which of the following language types is the BEST option?
A. Markup language
B. Scripting language
C. Compiled language
D. Interpreted language
C. Compiled Language
high performance
Compiled languages are translated directly into machine code that the processor can execute. They are often chosen for projects where high performance is a requirement because the code is translated into efficient machine code before execution, resulting in faster performance compared to interpreted languages.
A consultant is designing a flowchart for a presentation. The flowchart uses red arrows to guide viewers to the next object. Which of the following represents the function being used?
A. Engagement
B. Sequence
C. Exit strategy
D. Color-coding
B. Sequence
The use of arrows in a flowchart represents the sequence or order of steps or processes. Red arrows guiding viewers to the next object indicate the flow or sequence of the steps in the flowchart, helping viewers understand the order in which things should be done.
Which of the following is a programming language data type that contains a list of related values, such as colors?
A. String
B. Array
C. Float
D. Boolean
B. Array
keyword = list
An array is a data structure that can hold a fixed-size sequential collection of elements of the same type. It is used to store a collection of related values under a single variable name. Arrays are particularly useful for storing lists of related values, such as colors, because they allow for easy access to individual elements based on their position within the array.
Which of the following contains reusable code?
A. Constant
B. Variable
C. Function
D. Array
C. Function
Functions are blocks of reusable code that perform a specific task. They allow you to break down your code into smaller, manageable pieces, which can be called and executed whenever needed.
Which of the following data types would BEST be used for conditional operators?
A. Boolean
B. Char
C. String
D. Float
A. Boolean
Boolean data type is the most suitable for conditional operators. It represents a binary value, typically true or false, and is commonly used in programming for making logical decisions. Conditional operators, such as comparisons (e.g., equal to, greater than, less than), logical AND, OR, and NOT, are often used to evaluate conditions in programming languages. Boolean data type is used to store the results of such conditions.
A developer needs to write an application that checks a car’s engine once it initializes, and then shuts the engine off if it does not return a specific value. Which of the following pseudocodes BEST illustrates this concept?
A. INITIALIZE
FOR “Time” => 8:00AM DISPLAY “TURN OFF ENGINE”
EXIT
B. INITIALIZE
WHILE “ENGINE” = ON disengage breaks ELSE INITIALIZE
EXIT
C. INITIALIZE
IF “ENGINE” = “1” THEN set power to “off”
EXIT
D. INITIALIZE
IF “ENGINE” = “null” THEN display red light AND power off
EXIT
D. INITIALIZE
IF “ENGINE”=”null” THEN display red light AND power off
EXIT
null would allow us not to return a specific value
This pseudocode checks if the engine status is “null” (indicating an issue or failure) and then takes the appropriate action by displaying a red light and powering off the engine. This aligns with the requirement to shut down the engine if it does not return a specific value.
Which of the following needs to be done for a line of code to call on a specific object that does not exist?
A. Set up an array.
B. Remove all constants.
C. Set up a loop.
D. Define a variable.
D. Define a variable
call on specific object
When a line of code needs to call on a specific object that does not exist, the first step is to define a variable that can hold a reference to that object. Variables are used to store data, and in this case, defining a variable allows the code to create a reference to the desired object, even if it does not yet exist.
Which of the following notational systems represents physical electrical impulses going into electronic and computing devices?
A. Decimal
B. Binary
C. Hexadecimal
D. ASCII
B. Binary
Binary notation is a notational system used to represent data and instructions in the form of 0s and 1s. In electronic and computing devices, physical electrical impulses are typically represented using binary digits (bits), where 0 represents a low voltage (absence of an electrical impulse) and 1 represents a high voltage (presence of an electrical impulse).
Which of the following language types would MOST likely be used to display information in a web browser?
A. Assembly
B. Scripting
C. Markup
D. Compiled
C. Markup
Markup languages are most likely to be used to display information in a web browser. A markup language is a system for annotating text or data to specify its structure, presentation, or behavior. In the context of web development, markup languages are used to create the structure and formatting of web pages. The most used markup language for web development is HTML (Hypertext Markup Language). HTML is used to define the structure and content of web pages, including elements such as headings, paragraphs, links, images, and forms.
A programmer has been tasked to write the logic of a program without knowledge of the language to be used. Which of the following BEST describes how the programmer can accomplish this task?
A. Write a script.
B. Write a narrative.
C. Write pseudocode.
D. Write a query.
C. Write pseudocode
Pseudocode is a high-level description of a computer program or algorithm that uses natural language elements mixed with programming language-like syntax. It is used as a way to plan out the logic of a program before actual coding begins. Pseudocode is independent of any specific programming language, allowing programmers to focus on the algorithmic logic without getting bogged down in language-specific syntax. Therefore, if a programmer is tasked with writing the logic of a program without knowledge of the language to be used, writing pseudocode would be the best approach. It allows the programmer to outline the steps and structure of the program in a clear and understandable manner, which can then be translated into actual code in the chosen programming language.
A programmer is designing an expert system that uses a series of closed-ended questions to arrive at specific output. Which of the following characteristics will MOST likely be used in the code for the expert system to achieve this?
A. Branching
B. Looping
C. Arrays
D. Vectors
A. Branching
Branching is the characteristic that is most likely to be used in the code for the expert system to achieve the functionality of using a series of closed-ended questions to arrive at specific output. Branching allows the program to make decisions based on the answers to questions or conditions evaluated during runtime. In the context of an expert system, branching would be used to navigate through a series of predetermined questions and responses, determining the appropriate path based on the user’s input or specific conditions. Each question may lead to different branches or paths within the system, ultimately leading to specific output or conclusions.
Which of the following is the number of bits contained in a byte?
A. 4
B. 8
C. 16
D. 1,024
B. 8
The number of bits contained in a byte is 8. A byte is a fundamental unit of digital information storage and processing in computing. It consists of 8 bits, each of which can represent a binary value of either 0 or 1. Bytes are commonly used to represent characters, numbers, and other data in computer systems.