Review 2 Flashcards
Which of the following numbers is written in hexadecimal format?
A. 100101
B. 3268
C. 18AF
D. 100101.11
18AF
Hexadecimal is also known as base 16. It uses the numbers 1 to 9 and letters A to F.
Which of the following terms describe concepts related to breaking code into smaller, repeatable sections? (Choose two.)
A. Functions B. Variables C. Containers D. Methods E. Objects
Functions and methods
Functions and methods are used to break code into small, reusable segments.
Which of the following are examples of object-oriented programming languages? (Choose two.)
A. Java B. XML C. Python D. C E. SQL
Java and Python
Java and Python are considered object-oriented languages, as are C++, C#, PHP, Perl, and Ruby.
Which of the following statements is true regarding arrays and vectors?
A. Arrays contain one data type and are dynamic in length. Vectors can have multiple data types and are fixed in length.
B. Arrays can have multiple data types and are fixed in length. Vectors have one data type and are dynamic in length.
C. Arrays can have multiple data types and are dynamic in length. Vectors have one data type and are fixed in length.
D. Arrays contain one data type and are fixed in length. Vectors can have multiple data types and are dynamic in length.
Arrays and vectors are containers for data. An array can have only one data type and is fixed in length. Vectors are more flexible, containing multiple data types and being dynamic in length.
A developer needs to use a code designation for non-English letters. Which notational system does the developer need to use?
Unicode
ASCII and Unicode are used for numerical representations of letters and symbols. ASCII covers English letters and some symbols. For non-English, use the superset of ASCII called Unicode.
Which of the following are examples of interpreted languages? (Choose two.)
A. Compiled
B. Query
C. Scripted
D. Markup
Scripted and Markup
The three classes of interpreted languages are scripting, scripted, and markup languages.
What type of high-level programming language is translated into machine code once and then executed many times?
A. Compiled
B. Scripted
C. Scripting
D. Markup
Compiled
Compiled language programs are compiled once and then executed as many times as needed. Scripted, scripting, and markup languages are interpreted languages, which are not compiled with a compiler.
A programmer wants to write code that directly accesses the computer’s hardware. Which is the best type of language for the programmer to use?
Assembly
Assembly is the lowest-level programming language, and it is used when developers want to access computer hardware directly.
Interpret the following logic. For data input on someone who is 20 years old, which category will they fall into?
if age < 13, then category “Child”
else if age < 20, then category “Teen”
else if age < 65 then category “Adult
Adult
The logic says that anyone younger than 20 is a teen, while anyone younger than 65 is an adult. Since this person is 20 exactly, they are in the Adult category.
A programmer is writing a program that needs to accept an input of someone’s name. What type of variable should the programmer create?
String
A string is a group of characters—technically, zero or more characters, but not having a fixed length.
Looping logic makes use of which of the following statements?
A. while
B. when
C. loop
D. if
Looping logic is characterized by the while statement.
In object-oriented programming, which of the following are integral parts of objects? (Choose two.)
A. Arrays
B. Properties
C. Attributes
D. Variables
Properties and Attributes
Objects are made up of properties, attributes, and methods. Arrays and variables could be part of an object but do not have to be.
A program shows the number 11010.11. Which data type is this?
Float
It’s a float data type, which is a number with a decimal place. It could be binary, but binary is a notational system, not a data type.
You have created an array that can hold 15 items, all of the integer data type. You want to add a 16th integer. Which of the following is the best approach to doing this?
A. Add it to the existing array.
B. Create a separate variable for the 16th integer.
C. Convert the integers to floats and add the 16th integer.
D. Create a vector and replace the array with it.
Create a vector and replace the array with it
Arrays are of a fixed length, so you can’t just add another variable if it’s at its maximum length. Vectors can have their length dynamically adjusted and might work better in this situation.
What type of programming language is designed to retrieve data from a database?
Query
Query languages are used to obtain data from databases.
Interpret the following logic. A law enforcement agency has received data indicating that there are ten current threats to public safety. What should the threat level be?
if threats < 3, then level “Green”
else if threats < 6, then level “Yellow”
else if threats < 9, then level “Orange”
else if threats < 12, then level “Red”
Red
The threat level should be red. Anything from 9 to 11 is in the red range.
Which of the following is an example of a markup language?
HTML or XML
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
Flowchart
A flowchart is designed to depict visually the sequence of events and logic within a program.
Which of the following programming language types is the lowest-level language?
A. Assembly
Assembly is the lowest-level programming language. Interpreted and compiled are high-level languages, and query languages are used to get data from a database.
Flowcharts depict which one of the following?
A. Programs
B. Objects
C. Functions
D. Identifiers
A. Programs
A flowchart is a visual depiction of a program. It includes the logic components, inputs, and all other properties of the program.
You have an address book for a small business with contact information for about 100 clients. The address book is used by two people. Which solution should you use to store the data?
A. Spreadsheet
B. Relational database
C. Word processing software
D. Nonrelational database
Spreadsheet
For a small number of rows, with only two people accessing the data, a spreadsheet is fine in this situation.
A database developer is working on generating queries. If the developer needs to ensure that the output of the query has data persistence, to where should the data be written?
A. RAM
B. Cache
C. SSD
D. CPU
C. SSD
Data persistence means that the data is permanently available. Hard drives store data in a persistent way, so the answer is SSD.
Which of the following consists of columns and rows of numerical or text data?
relational database
A relational database has structured data, which is predictable and organized, with tables containing columns and rows of text or numerical data.
Joe creates a database. What does he need to do next to make it usable?
A. Enable permissions
B. Import data
C. Run queries
D. Create forms
import data
After a database is created, data needs to be imported or inputted.