Software Development Flashcards

Objective 4

1
Q

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

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

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

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

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

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which of the following programming concepts uses properties and attributes?

A. Objects

B. Functions

C. Containers

D. Identifiers

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

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.

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Which of the following is an example of a compiled language?

A. C++

B. SQL

C. Python

D. XML

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which of the following data types should a database administrator use to store customer postal codes?

A. Float

B. String

C. Boolean

D. Integer

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Given this example:

FEB8077911AB12TB -
Which of the following is being represented?

A. MAC address

B. String

C. Hexadecimal

D. Unicode

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

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

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

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

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Which of the following shows how many results are possible when evaluating Boolean data types?

A. Two

B. Four

C. Three

D. Five

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

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

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

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

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

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

A

D. 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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

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

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Which of the following contains reusable code?

A. Constant

B. Variable

C. Function

D. Array

A

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.

18
Q

Which of the following data types would BEST be used for conditional operators?

A. Boolean

B. Char

C. String

D. Float

A

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.

19
Q

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

A

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.

20
Q

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.

A

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.

21
Q

Which of the following notational systems represents physical electrical impulses going into electronic and computing devices?

A. Decimal

B. Binary

C. Hexadecimal

D. ASCII

A

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).

22
Q

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

A

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.

23
Q

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.

A

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.

24
Q

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

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.

25
Q

Which of the following is the number of bits contained in a byte?

A. 4

B. 8

C. 16

D. 1,024

A

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.

26
Q

Which of the following is typically used to lay out documents with images and text for the web?

A. C++

B. HTML

C. Python

D. JavaScript

A

B. HTML

HTML (Hypertext Markup Language) is typically used to lay out documents with images and text for the web. HTML provides a markup language that defines the structure and content of web pages. It allows developers to create text-based documents that include elements such as headings, paragraphs, lists, links, images, and more. With HTML, developers can specify the layout and arrangement of text and images within a web page, controlling how content is displayed to users in web browsers.

27
Q

A development team is brainstorming how a new program should operate. Which of the following techniques can be used to depict the program visually during brainstorming?

A. Flowchart

B. Spreadsheet

C. Pseudocode

D. Branching

A

A. Flowchart

Flowcharts are graphical representations of a process, showing the steps and decision points involved in executing a program or algorithm. Flowcharts use symbols such as rectangles (to represent processes or actions), diamonds (to represent decisions), and arrows (to show the flow of control) to visually depict the flow of logic within a program. Flowcharts are commonly used during brainstorming sessions to visually map out the steps and logic of a new program, helping the development team to understand and refine the program’s operation.

28
Q

Which of the following is the MOST likely reason to use an array?

A. To define a list of objects

B. To identify potential looping code

C. To flag a list of functions

D. To describe the properties of a program

A

A. To define a list of objects

Arrays are commonly used to define a list of objects in programming. An array is a data structure that stores a collection of elements, such as numbers, strings, or objects, all of which have the same data type. By using arrays, programmers can efficiently manage and manipulate lists of objects, accessing individual elements by their index within the array.

29
Q

Given the following code:

f = 2;

//moving fruit from inventory to fruit display

switch (f)

{

case 1:

Take 10 apples out of inventory; 

break; 

case 2:

Take 10 pears out of inventory; 

break; 

case 3:

Take 10 peaches out of inventory; 

break; 

case 4:

Take 10 kiwi out of inventory; 

break; 

};

Which of the following case choices would be executed?

a. Ten apples would be moved from inventory to the fruit display.

b. Ten pears would be moved from inventory to the fruit display.

c. Ten peaches would be moved from inventory to the fruit display.

d. Ten kiwi would be moved from inventory to the fruit display.

A

b. Ten pears would be moved from inventory to the fruit display.

Ten pears would be moved from inventory to the fruit display: The value of variable ‘f’ is set to 2. In the switch statement, the case corresponding to the value of ‘f’ will be executed. Since ‘f’ is set to 2, the case 2 will be executed, which is “Take 10 pears out of inventory”.

30
Q

Given the following pseudocode:

For each apple in the basket, eat two oranges unless it is the last apple, then eat three oranges.

If there are seven apples in the basket, which of the following would be the number of oranges a person eats?

A.10
B.14
C.15
D.17

A

C. 15

Following the pseudocode, for each of the first six apples, the person would eat two oranges. Then, for the seventh (last) apple, they would eat three oranges. Therefore, the total number of oranges eaten would be 6×2+3 = 12+3 =15.

31
Q

When developing a game, a developer creates a boss object that has the ability to jump. Which of the following programming concepts does jump represent?

A. Method
B. Object
C. Property
D. Attribute

A

A. Method

In object-oriented programming (OOP), methods are functions associated with objects. The ability to “jump” in this context likely involves a function or method associated with the boss object that allows it to perform the action of jumping.

32
Q

Consider the following Statements:

if userin = “commander”
then clearance = “topsecret”
else if userin = “analyst”
then clearance = “restricted”
else
clearance = “normal”

Giving the input (userin) analyst, which of the following would the clearance variable be set to?

A. topsecret

B. normal

C. analyst

D. restricted

A

D. Restricted

Restricted: According to the provided statements, if the value of userin is “analyst”, then the clearance variable will be set to “restricted”. This is because the second condition is met (userin equals “analyst”), and the corresponding action is to set clearance to “restricted”.

33
Q

Given the following pseudocode :

Initialize variable NAME to “ “

Initialize variable TIME to “NOON”

Initialize variable DATE to “Monday”

If TIME == “NOON”

Set variable NAME to “foo”

Else if TIME == “MIDNIGHT”

Set variable NAME to “bar”

If DATE ==”Monday”

Set variable NAME to NAME concatenated with “sad”

Else if DATE == “Friday”

Set variable NAME to NAME concatenated with “happy”

Print NAME

Which of the following would be the output of the program?

A. foohappy

B. barsad

C. foosad

D. barhappy

A

C. Foosad

The output of the program would be “foosad”. Here’s why:

  1. The variable TIME is initialized to “NOON”.
  2. The if condition checks if TIME is “NOON”, which it is, so it sets NAME to “foo”.
  3. The else if condition for TIME being “MIDNIGHT” is skipped because TIME is not “MIDNIGHT”.
  4. Then, the variable DATE is checked. It’s initialized to “Monday”.
  5. The if condition checks if DATE is “Monday”, which it is, so it sets NAME to NAME concatenated with “sad”. Since NAME was previously set to “foo”, now it becomes “foosad”.
  6. The else if condition for DATE being “Friday” is skipped because DATE is not “Friday”.
  7. Finally, it prints the value of NAME, which is “foosad”.

So, the correct answer is “foosad”.

34
Q

Which Notation would 10 have the most digits?

a.Octal

b.Dec

c.Hex

d.Bin

A

D. Binary

a. Octal: 10 in octal is 12, which has 2 digits.

b. Dec (Decimal): 10 in decimal already is 10, which has 2 digits.

c. Hexadecimal (Hex): 10 in hexadecimal is A, which has 1 digit.

d. Bin (Binary): 10 in binary is 1010, which has 4 digits.

35
Q

Which one of these relates to a break?

A. Branches
B. Loops
C. Arrays
D. Vectors

A

B. Loops

Example code:

while (true){
break;
print(“infinite loop”)
}

In this example, you would break out of the loop immediately, even though the loop should be infinite. The break statement is essentially an escape from whatever branching or looping statement you are within.

36
Q

What would need to be done to a line of code that does not contain or return a value?

A. Create and array

B. Define a variable

C. Create a loop
D. Gather user input

A

B. Define a variable

Defining a variable allows you to allocate memory space and name it, setting it up for later use in your program. Even if the line of code doesn’t directly return or manipulate a value, defining a variable can still be a meaningful action, especially if you intend to use that variable later in your code.

Creating an array or creating a loop are specific actions that require more than just a single line of code. While you may use a single line to initiate these actions, the actual setup and configuration would involve additional code.

37
Q

1,000,000MB can also be represented as what?

A.0.01PB

B. 1TB

C. 100GB

D. something else

A

B. 1 TB

1 terabyte (TB) is equal to 1,024 gigabytes (GB), and 1 gigabyte is equal to 1,024 megabytes.

Therefore, 1,000,000 MB is equal to 1 TB.

38
Q

You want to understand the sequence of a program, from start to finish. Which of the following is the best to use for this purpose?

A. Pseudocode

B. Function

C. Flowchart

D. Object

A

C. Flowchart

understand sequence

A flowchart is a graphical representation of a process, showing the steps involved and the sequence in which they are executed. Flowcharts are well-suited for visualizing the sequence of operations in a program, making it easier to understand the logic and control flow.

39
Q

Which of the following numbers is written in hexadecimal format?

A. 100101

B. 3268

C. 18AF

D. 100101.11

A

D. 18AF

Hexidecimal = letters a-f and numbers 0-9

40
Q

A business person mapping out a self service phone tree, want to know which concepts is being used.
A. flow charting
B. pseudocode
C. color coding
D. looping

A

A. Flowcharting

Flow charting is the concept used when mapping out a phone tree, as it involves creating a diagram that shows the various steps and decision points in a process, such as the options a caller would select in a phone tree.

B. Pseudocode: This is more commonly used in programming to outline code logic but not for visual mapping of processes like a phone tree.
C. Color coding: Refers to visually distinguishing elements using colors, not relevant to process mapping.
D. Looping: A programming concept where a process repeats, which isn’t directly applicable to the mapping of a phone tree.

41
Q

How many times will the loop iterate?

while x < 12
print hello
add 1 to x
x = 7

A. 4
B. 5
C. 7
D. 12

A

B. 5 times

The loop starts at 7 since x = 7. There are 5 numbers between 7 and 12. The loop will stop at 12.

42
Q

A software engineer writes a program, the accounting department wants changes made specific to their needs. Which concept would this use?
A. Branching
B. Looping
C. Flowchart
D. Vector

A

A. Branching

Branching refers to making decisions in a program that lead to different outcomes or actions based on certain conditions. In this case, the software would need modifications or branches added to address the specific needs of the accounting department.

B. Looping: Repeatedly executes a section of code, which isn’t relevant to modifying software for specific needs.
C. Flowchart: A visual representation of a process or program logic, not directly related to the software changes.
D. Vector: A mathematical or graphical concept, not relevant to making changes to software code.