















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!
















Which operator should be used to determine if a number is evenly divisible by 5?
ANSWER %
A car drove 200 miles using 10 gallons of fuel. Which operation should be used to compute the miles per gallon, which is 20?
ANSWER Division
A variable should hold a person's height in meters. Which data type should the variable be?
ANSWER Float
A variable should hold the names of all past U.S. presidents. Which data type should the variable be?
ANSWER 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?
ANSWER 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?
ANSWER Constant integer minAge
Given integer x = 3 and integer y = 5. What is the value of the expression ( x / 2.0) + y?
ANSWER
Given float x = 10.2 and float y = 1.0. What is the value of the expression x / y?
ANSWER
What kind of operator is the == in the expression i == 20?
ANSWER Equality
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?
ANSWER 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?
ANSWER x
A function calculates the weight difference (Diff) given two sample weights (S1 and S2). What should be the output from the function?
ANSWER Diff
function P(integer x) returns integer y y = 2 * x What does P(5) evaluate to?
ANSWER 10
Function F() Put "Hey" to output What entire output appears after three successive calls to F()?
ANSWER HeyHeyHey
What is a valid user-defined function name?
ANSWER Any valid identifier
A function MyFct has an input x and an output z. What does MyFct return?
ANSWER z only
What is the return value of a function?
ANSWER 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?
ANSWER 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?
ANSWER Do-while loop
What is the loop variable initialization in the following pseudocode? y = 0 s = 100. while y < 10 s = s + (s * 5.0) y = y + 1
ANSWER y = 0
Order the steps needed to output the minimum of x and y from first (1) to last (4). A Declare variable min B Put min to output C min = x D If y < min, set min = y
ANSWER ACDB
Order the steps needed to calculate speed in miles per hour given a start and end location and time traveled in hours from first (1) to last (4). A Put speedMph to output B Declare variables distMiles and speedMph C distMiles = endLocation - startLocation D speedMph = distMiles / timeHours
ANSWER BCDA
Order the tasks needed to create a pyramid (large on bottom, small on top) on a table from first (1) to last (4). A Place largest shape. B Clear table C Place smallest shape. D Place middle-sized shape.
ANSWER BADC
What does the following algorithm determine? if x == y z = 1 else z = 0
ANSWER Whether x and y are the same
What does the following algorithm accomplish?
x = Get next input if x == - Put "Goodbye" to output
ANSWER Outputs Goodbye when user types -
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
Which phase of a waterfall approach would create a sequence diagram that specifies the required order of events between completed program components?
ANSWER Design
Which phase of an agile approach would define a hypothesis to find a problem in a program?
ANSWER Testing
Which phase of an agile approach would create an executable program?
ANSWER Implementation
Which phase of an agile approach would create a list of components needed to build an online auction site?
ANSWER Design
Which phase of a waterfall approach defines a program's goals?
ANSWER 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?
ANSWER 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?
ANSWER 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?
ANSWER 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?
ANSWER Analysis
What is an advantage of using a programming library?
ANSWER The code has already been tested
Which language is dynamically typed?
ANSWER Python
Which language is not built on object-oriented design principles?
ANSWER 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?
ANSWER 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?
ANSWER Statically typed
A language uses tags around text to indicate how that text should be formatted. Which characteristic describes a language having such tags?
ANSWER Markup
What is a characteristic of a compiled language?
ANSWER Converts to machine language before running
What is a characteristic of an interpreted language?
ANSWER Runs easily on difefrent kinds of machines
What is an advantage of interpreted programs?
ANSWER They can be modified at run time
Which characteristic specifically describes a markup language?
ANSWER Tags surround text to describe desired formatting
Which characteristic specifically describes interpreted languages?
ANSWER They can be run one statement at a time
Algorithm
ANSWER A sequence of instructions that solves a problem.
Flowchart
ANSWER A graphical language for creating or viewing computer programs.
Run execute
ANSWER Carrying out a program's statements.
String literal
ANSWER Consists of text (characters) within double quotes, as in "Go #57!".
Characters
ANSWER Any letter (a-z, A-Z), digit (0-9), or symbol (~, !, @, etc.).
Newline
ANSWER A two-character sequence \n whose appearance in an output string literal causes the cursor to move to the next output line.
Comment
ANSWER Text a programmer adds to a program, to be read by humans to better understand the code, but ignored by the program when executing.
Whitespace
ANSWER Refers to blank spaces (space and tab characters) between items within a statement, and to newlines.
Moore's Law
ANSWER Engineers have reduced switch sizes by half about every 2 years.
Assignment statement
ANSWER Assigns a variable with a value, such as x = 5.
Variable declaration
ANSWER Specifies the variable's name and type.
Integer
ANSWER Can hold whole number values, like 1, 999, 0, or -25 (but not 3.5 or 0.001).
Parameter
ANSWER A function input specifeid in a function definition.
Loop
ANSWER A program that repeatedly executes statements while the expression is true; when false, execution proceeds past.
Pseudocode
ANSWER Text that resembles a program in a real programming language but is simplified to aid human understanding.
if else
ANSWER A decision and its two branches. Because IF the decision's expression is true then the first branch executes, ELSE the second branch executes.
Boolean
ANSWER A type that has just two values: true or false.
While loop
ANSWER A loop that repeatedly executes the loop body while the loop's expression evaluates to true.
For loop
ANSWER A loop with three parts at the top: a loop variable initialization, a loop expression, and a loop variable update.
Do While loop
ANSWER A loop that first executes the loop body's statements, then checks the loop condition.
Array
ANSWER An ordered list of items of a given data type.
Function call
ANSWER Consists of the function name and parentheses, within which comma-separated arguments (if any) appear.
Analysis
ANSWER This first SDLC phase determines the goals and requirements for a system.
Design
ANSWER This second SDLC phase defnies specifics of how to build a program.