Pre-assessment Flashcards

1
Q

Which operator should be used to determine if a number is evenly divisible by 5?

A

%

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

A car drove 200 miles using 10 gallons of fuel. Which operation should be used to compute the miles per gallon, which is 20?

A

Division

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

A variable should hold a person’s height in meters. Which data type should the variable be?

A

Float

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

A variable should hold the names of all past U.S. presidents. Which data type should the variable be?

A

String

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

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?

A

Constant integer secondsPerMinute

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

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?

A

Constant integer minAge

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

What kind of operator is the == in the expression i == 20?

A

Equality

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

Which data type is used for items that are measured in length?

A

Float

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

Which data type should be used to keep track of how many planes are in a hangar?

A

Integer

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

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

A

3 2 1

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

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?

A

‘Hello’ will print indefinitely.

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

What is the loop expression in the follow- ing pseudocode?
i = 0
while i < 20 Put i to output i= i+ 1

A

i < 20

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

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

A

y= 0

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

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.

A

Declare variable

min min = x

If y < min, set min = y

Put min to output

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

What does the following algorithm deter- mine?
if x == y
z= 1
else
z =0

A

Whether x and y are the same

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

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

A

At least one integer is negative.

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

When should a programmer develop an algorithm to solve a problem?

A

Before writing a program to solve the problem

18
Q

Which text represents an algorithm?

A

Insert key, turn key, open door.

19
Q

Which text represents an algorithm? 2

A

Shake bulb; if it rattles, replace it.

20
Q

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?

A

Input 99, 0, 5. Ensure output is “Not OK

21
Q

What is the purpose of a use case dia- gram, such as the following diagram?

A

Describes how a user can interact with a program

22
Q

Which elements are characteristic of a class diagram?

A

System’s classes, attributes, and meth- ods and their features, constraints, and relationships

23
Q

Review the following use case diagram:

A

Provides an overview of several use cases

24
Q

Which phase of a waterfall approach would create a sequence diagram that specifies the required order of events be- tween completed program components?

A

Analysis
Design
Implementation
Testing
Checkmark
Checkmark

25
Q

Which phase of an agile approach would define a hypothesis to find a problem in a program?

A

Analysis
Design
Implementation
Testing CORRECT

26
Q

Which phase of an agile approach would create an executable program?

A

Analysis
Design
Implementation CORRECT
Testing

27
Q

Which phase of a waterfall approach de- fines a program’s goals?

A

Analysis CORRECT
Design
Implementation
Testing

28
Q

Which phase of a waterfall approach de- fines a program’s goals?

A

Analysis CORRECT
Design
Implementation
Testing

29
Q

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?

A

Analysis
Design
Implementation CORRECT
Testing

30
Q

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

A

Implementation

31
Q

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

A

Implementation

32
Q

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.

A

They can run on any machine having the right interpreter.

33
Q

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.

A

They can be run one statement at a time.

34
Q

What is an advantage of interpreted pro- grams?

A

They can be modified at run time.

35
Q

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

A

Runs easily on different kinds of ma- chines

36
Q

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

A

Converts to machine language before running

37
Q

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

A

Markup

38
Q

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

A

Statically typed

39
Q

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

A

Object-oriented

40
Q

Which language is not built on object-ori- ented design principles?

C
C++
Java
Python

A

C

41
Q

Which language is dynamically typed?

C
C++
Java
Python

A

Python