Pre-assessment Flashcards
Which operator should be used to determine if a number is evenly divisible by 5?
%
A car drove 200 miles using 10 gallons of fuel. Which operation should be used to compute the miles per gallon, which is 20?
Division
A variable should hold a person’s height in meters. Which data type should the variable be?
Float
A variable should hold the names of all past U.S. presidents. Which data type should the variable be?
String
A program uses the number of seconds in a minute in various calculations. How should the item that holds the number of seconds in a minute be declared?
Constant integer secondsPerMinute
A program determines if a user’s age is high enough to run for U.S. president. The minimum age requirement is 35. How should the item that holds the min- imum age be declared?
Constant integer minAge
What kind of operator is the == in the expression i == 20?
Equality
Which data type is used for items that are measured in length?
Float
Which data type should be used to keep track of how many planes are in a hangar?
Integer
What is put to output by the following pseudocode?
x= 3
do
Put x to output
Put “ “ to output
x = x -1
while x > 0
3 2 1
A programmer has developed the follow- ing code:
count = 0
while count is less than 5: print ‘Hello’
What is the result of implementing this code?
‘Hello’ will print indefinitely.
What is the loop expression in the follow- ing pseudocode?
i = 0
while i < 20 Put i to output i= i+ 1
i < 20
What is the loop variable initialization in the following pseudocode?
y= 0
s = 100.0
while y < 10
s = s + (s * 5.0) y= y+ 1
y= 0
Order the steps needed to output the minimum of x and y from first (1) to last (4).
Select your answer from the pull down list.
Declare variable
min min = x
If y < min, set min = y
Put min to output
What does the following algorithm deter- mine?
if x == y
z= 1
else
z =0
Whether x and y are the same
What does an output of 1 indicate for the following algorithm running on a five-el- ement list of integers?
i= 0
x= 0
while i < 5
if list[i] < 0
x= 1
i= i+ 1
Put x to output
At least one integer is negative.
When should a programmer develop an algorithm to solve a problem?
Before writing a program to solve the problem
Which text represents an algorithm?
Insert key, turn key, open door.
Which text represents an algorithm? 2
Shake bulb; if it rattles, replace it.
An algorithm should output “OK” if a list’s numbers are all non-zero, else the out- put is “Not OK.”
Which test is a valid test of the algo- rithm?
Input 99, 0, 5. Ensure output is “Not OK
What is the purpose of a use case dia- gram, such as the following diagram?
Describes how a user can interact with a program
Which elements are characteristic of a class diagram?
System’s classes, attributes, and meth- ods and their features, constraints, and relationships
Review the following use case diagram:
Provides an overview of several use cases
Which phase of a waterfall approach would create a sequence diagram that specifies the required order of events be- tween completed program components?
Analysis
Design
Implementation
Testing
Checkmark
Checkmark
Which phase of an agile approach would define a hypothesis to find a problem in a program?
Analysis
Design
Implementation
Testing CORRECT
Which phase of an agile approach would create an executable program?
Analysis
Design
Implementation CORRECT
Testing
Which phase of a waterfall approach de- fines a program’s goals?
Analysis CORRECT
Design
Implementation
Testing
Which phase of a waterfall approach de- fines a program’s goals?
Analysis CORRECT
Design
Implementation
Testing
A programmer decides a program should convert U.S. units to metric units and decides to write the program in C++ using several functions.
Which phase of a waterfall approach is occurring when the programmer starts writing the program?
Analysis
Design
Implementation CORRECT
Testing
A programmer shows a program’s first version to a customer. Based on feed- back, the programmer begins writing a second version of the program.
In which phase of an agile approach does the writing of a second version of the program occur?
Analysis
Design
Implementation
Testing
Implementation
A programmer is currently programming the fourth version of a program. Each version has additional features to satisfy more customers.
In which phase of an agile approach does the programming of the fourth ver- sion occur?
Analysis
Design
Implementation
Testing
Implementation
Which characteristic specifically de- scribes interpreted languages?
They are drawn out using graphical dia- grams.
They can run on any machine having the right interpreter.
They are compiled to machine code be- fore being executed.
They substantially support decomposing a program into objects.
They can run on any machine having the right interpreter.
Which characteristic specifically de- scribes interpreted languages?
They are written using pseudocode.
They consist of a set of functions and objects.
They can be run one statement at a time.
They are converted to 0’s and 1’s.
They can be run one statement at a time.
What is an advantage of interpreted pro- grams?
They can be modified at run time.
What is a characteristic of an interpreted language?
Runs faster than compiled languages
Outputs an interpreter to run the pro- gram
Runs easily on different kinds of machines
Needs to be converted to machine code first
Runs easily on different kinds of ma- chines
What is a characteristic of a compiled language?
Runs one statement at a time by another program
Is slower than an interpreted language
Converts to machine language before running
Runs on any machine having an interpreter
Converts to machine language before running
A language uses tags around text to indi- cate how that text should be formatted.
Which characteristic describes a lan- guage having such tags?
Objects
Compiler
Script
Markup
Markup
A programmer wants a compiler to re- port an error if an integer variable is as- signed with a string.
Which kind of language should the pro- grammer use?
Dynamically typed
Object-oriented
Markup
Statically typed
Statically typed
A language substantially supports a pro- grammer creating items like person, teacher, and students. Each item has internal data and some operations.
Which characteristic describes that lan- guage?
Dynamically typed
Object-oriented
Markup
Statically typed
Object-oriented
Which language is not built on object-ori- ented design principles?
C
C++
Java
Python
C
Which language is dynamically typed?
C
C++
Java
Python
Python