1/69
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
A car drove 200 miles using 10 gallons of fuel. Which operation should be used to compute the miles per gallon, which is 20?
Addition
Subtraction
Multiplication
Division
Division
Which operator should be used to determine if a number is evenly divisible by 5?
+
-
*
%
%
A variable should hold a person's height in meters.
Which data type should the variable be?
Integer
Float
String
Boolean
Float
A variable should hold the names of all past U.S. presidents. Which data type should the variable be?
Integer array
Float array
String array
Boolean array
String array
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 float userTime
Variable float userTime
Constant integer secondsPerMinute
Variable integer secondsPerMinute
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 minimum age be declared?
Constant integer minAge
Variable integer minAge
Constant integer 35
Variable integer 35
Constant integer minAge
Given integer x = 3 and integer y = 5. What is the value of the expression (x / 2.0) + y?
5.0
6.0
6.5
7.5
7.5
Given float x = 10.2 and float y = 1.0. What is the value of the expression x / y?
0.0
1.0
10
10.2
10.2
What kind of operator is the == in the expression i == 20?
Assignment
Arithmetic
Equality
Logical
Equality
What is the purpose of parentheses () in a programming expression?
To print expressions
To group expressions
To run expressions
To compose expressions
To group expressions
Given float x = 3.0. Which expression evaluates to 2.0?
x/3*2+2
x-2/3
X+0.5/2
x/2+0.5/2+.25
x/2+0.5/2+.25
Which expression represents all the values of x, when x is the age ranging from 18 to 24 years old?
(x > = 18) or (x < = 24)
(x >= 18) and (x <= 24)
(x < 18) or (x > 24)
(x < 18) and (x > 24)
(x >= 18) and (x <= 24)
Which data type is used for items that are measured in length?
Integer
Float
String
Boolean
Float
Which data type should be used to keep track of how many planes are in a hangar?
Integer
Float
String
Boolean
Integer
What does a programmer do first to use an existing programming library?
Write the library's functions
Odify the library's functions
Include the library
Discard the library
Include the library
What relationship is common among a programming library's functions?
Functions all relate to the same purpose.
Each function competes with the other function.
Each function fixes bugs in the other functions.
Every function performs the identical computation.
Functions all relate to the same purpose.
What is an advantage of using a programming library?
The code has not been tested
The code has already been tested
The code can be used across programming languages
The code has already been compiled
The code has already been tested
Which language is dynamically typed?
C
C++
Java
Python
Python
Which language is not built on object-oriented design principles?
C
C++
Java
Python
C
A language substantially supports a programmer creating items like person, teacher, and students. Each item has internal data and some operations. Which characteristic describes that language?
Dynamically typed
Object-oriented
Markup
Statically typed
Object-oriented
A programmer wants a compiler to report an error if an integer variable is assigned with a string. Which kind of language should the programmer use?
Dynamically typed
Object-oriented
Markup
Statically typed
Statically typed
A language uses tags around text to indicate how that text should be formatted. Which characteristic describes a language having such tags?
Objects
Compiler
Script
Markup
Markup
What is a characteristic of a compiled language?
Runs one statement at a time by another program
Runs one statement at a time by another program
Converts to machine language before running
Runs on any machine having an interpreter
Converts to machine language before running
What is a characteristic of an interpreted language?
Runs faster than compiled languages
Outputs an interpreter to run the program
Runs easily on different kinds of machines
Needs to be converted to machine code first
Runs easily on different kinds of machines
What is an advantage of interpreted programs?
They generally run faster than compiled programs.
They can be modified at run time
They use memory more efficiently.
They create a separate file.
They can be modified at run time
Which characteristic specifically describes a markup language?
Tags surround text to describe desired formatting.
A program's execution marks output with numbers and strings.
A compiler marks statements with 0's and 1's.
An interpreter executes statements one at a time.
Tags surround text to describe desired formatting.
Which characteristic specifically describes 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.
Which characteristic specifically describes interpreted languages?
They are drawn out using graphical diagrams.
They can run on any machine having the right interpreter.
They are compiled to machine code before being executed.
They substantially support decomposing a program into objects.
They can run on any machine having the right interpreter.
A function should convert hours and minutes to seconds, such as converting 1 hour and 10 minutes to 4,200 seconds. What should be the input to the function?
Hours only
Minutes
Only
Hours and minutes
Hours, minutes, and seconds
Hours and minutes
A function returns a number x cubed. For example, if x is 3, the function returns 3 3 3, or 27. What should be the input to the function?
x
x, x
x, x, x
27
x
A function calculates the weight difference (Diff) given two sample weights (S1 and S2). What should be the output from the function?
S1 only
S2 only
S1 and S2
Diff
Diff
function P(integer x) returns integer y y = 2 * x What does P(5) evaluate to?
2
5
10
25
10
Function F() Put "Hey" to output What entire output appears after three successive calls to F()?
Hey
HHHey
HeyHeyHey
Hey Hey Hey
HeyHeyHey
What is a valid user-defined function name?
A reserved word
Any valid identifier
Any variable name
A floating-point number
Any valid identifier
A function MyFct has an input x and an output z. What does MyFct return?
Nothing
x only
z only
x and z
z only
What is the return value of a function?
Output of a function
Call to run the function
Data passed to the function
Variable in the declaration of the function
Output of a function
A program should continue accepting input numbers, adding each to a sum, until a 0 is input. Which control structure should be used?
If statement
For loop
Multiple if statements
While loop
While loop
Joe is building an online game. He wants to provide a riddle and have the player guess the answer. The game needs to prompt the user to enter the answer, check to see if it the input provided does not match the correct answer, and continue prompting the user until the answer entered matches the correct answer. Which control structure supports Joe's needs?
For loop
While loop
Do-while loop
If-else branch
Do-while loop
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 0
3 2 1 0 -1
2 1 0
3 2 1
3 2 1
A programmer has developed the following code: count = 0 while count is less than 5: print 'Hello' What is the result of implementing this code?
'Hello' will print four times
'Hello' will print five times
The program will throw an error
'Hello' will print indefinitely
'Hello' will print indefinitely
What is the loop expression in the following pseudocode? i = 0 while i < 20 Put i to output i = i + 1
i
i<20
i=0
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
y = y + 1
s = 100.0
s = s + (s * 5.0)
y = 0
Which phase of a waterfall approach would create a sequence diagram that specifies the required order of events between completed program components?
Analysis
Design
Implementation
Testing
Design
Which phase of an agile approach would define a hypothesis to find a problem in a program?
Analysis
Design
Implementation
Testing
Testing
Which phase of an agile approach would create an executable program?
Analysis
Design
Implementation
Testing
Implementation
Which phase of an agile approach would create a list of components needed to build an online auction site?
Analysis
Design
Implementation
Testing
Design
Which phase of a waterfall approach defines a program's goals?
Analysis
Design
Implementation
Testing
Analysis
After a programmer is done writing a program, another person runs the program hundreds of times, each time with different input, checking that each run yields correct output. Which phase of a waterfall approach is the person carrying out?
Analysis
Design
Implementation
Testing
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
Testing
Implementation
A company has a new project it wishes to implement to track and analyze employee and customer interactions. The company leadership determines that the system should support direct data entry as well as automated data capture of phone calls and emails. Which phase of the waterfall process is occurring?
Analysis
Design
Implementation
Testing
Analysis
A programmer shows a program's first version to a customer. The customer provides feedback, which causes the programmer to change the goals of the program. In which phase of an agile approach are goals changed based on customer feedback?
Analysis
Design
Implementation
Testing
Analysis
A programmer shows a program's first version to a customer. Based on feedback, 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 shows a program's first version to a customer. Based on feedback, the programmer creates a second version, and then has a colleague run the second version on numerous inputs to ensure outputs are correct. Which phase of an agile approach is that colleague carrying out?
Analysis
Design
Implementation
Testing
Testing
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 version occur?
Analysis
Design
Implementation
Testing
Implementation
Order the statements needed to output the minimum of x and y from first (1) to last (4). Select your answer from the pull down list.
If y < min, set min = y
Declare variable min
min = x
Put min to output
Answer:
Declare variable min
min = x
If y < min, set min = y
Put min to output
Given a start and end location and time traveled in hours, order the statements needed to calculate speed in miles per hour from first (1) to last (4). Select your answers from the pull-down list.
speedMph = distMiles / timeHours
Declare variables distMiles and speedMph
Put speedMph to output
DistMiles = endLocation - startLocation
Answer:
Declare variables distMiles and speedMph
DistMiles = endLocation - startLocation
speedMph = distMiles / timeHours
Put speedMph to output
Order the tasks needed to create a pyramid (large on bottom, small on top) on a table from first (1) to last (4). Select your answer from the pull down list.
Place largest shape
Place smallest shape
Place middle-sized shape
Clear table
Answer:
Clear table
Place largest shape
Place middle-sized shape
Place smallest shape
What does the following algorithm determine? if x == y z = 1 else z = 0
Whether x and y are the same
Whether x and y are negative
Whether x is 1
Whether x is 0
Whether x and y are the same
What does the following algorithm accomplish? x = Get next input if x == -1 Put "Goodbye" to output
Outputs -1 when user types any input
Outputs "x" when user types -1
Outputs -1 when x is positive
Outputs Goodbye when user types -1
Outputs Goodbye when user types -1
What does an output of 1 indicate for the following algorithm running on a five-element list of integers? i = 0 x = 0 while i < 5 if list[i] < 0 x = 1 i = i + 1 Put x to output
All integers are positive.
All integers are negative.
At least one integer is negative.
At least one integer is positive.
At least one integer is negative.
When should a programmer develop an algorithm to solve a problem?
Before knowing the problem
Before writing a program to solve the problem
While writing a program to solve the problem
After writing a program to solve the problem
Before writing a program to solve the problem
Which text represents an algorithm?
Cats and dogs have tails.
Insert key, turn key, open door.
The forecast for tomorrow is rain.
A box has balls, bats, and hats.
Insert key, turn key, open door.
Which text represents an algorithm?
Shake bulb; if it rattles, replace it.
Water is wet; fire is not wet.
Staring at the sun hurts the eyes.
The max speed is 60 mph.
Shake bulb; if it rattles, replace it.
An algorithm should output "OK" if a list's numbers are all non-zero, else the output is "Not OK." Which test is a valid test of the algorithm?
Input 0, 0, 0. Ensure output is "OK."
Input 5, 4, 0. Ensure output is "OK."
Input -3, -2, 5. Ensure output is "Not OK."
Input 99, 0, 5. Ensure output is "Not OK."
Input 99, 0, 5. Ensure output is "Not OK."
What is put to output by the following flowchart, if the input is 17?
Too young
OK
Too old
Nothing is put to output.
OK
What is put to output by the following flowchart, if the input is 3 5 -1?
3 5 -1
3 5
6 10
6 10 -2
6 10
What is the purpose of the following class diagram?
Shows how the Employee class is used in the program
Describes the execution flow of the Employee class' operations
Specifies the Employee class' behavioral requirements
Depicts the Employee class' name, data members, and functions
Depicts the Employee class' name, data members, and functions
What is the purpose of a use case diagram, such as the following diagram?
Describes how a user can interact with a program
Describes the data used in the program
Illustrates the flow of the program's algorithms
Shows the interaction between program components
Describes how a user can interact with a program
Which elements are characteristic of a class diagram?
System's classes, attributes, and methods and their features, constraints, and relationships
Flow of logic and process interaction within a system
Physical resources or logical architecture of a system
Internal structure of a class and collaboration between classes or instances
System's classes, attributes, and methods and their features, constraints, and relationships
Review the following use case diagram:
What does a use case diagram do?
Diagrams a single use case
Connects several use cases to class diagrams
Provides an overview of several use cases
Lists use case goals
Provides an overview of several use cases