WITH CORRECT ANSWERS GRADED A+
◍ 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
◍ Assignment statement.
Answer: Assigns a variable with a value, such as x = 5.
◍ Implementation.
Answer: This third SDLC phase involves writing the program.
◍ Waterfall method.
Answer: Each phase is done in sequence, entirely completing one phase
before moving to the next phase.
◍ Which phase of an agile approach would create an executable program?.
Answer: Implementation
◍ What relationship is common among a programming library's functions?.
Answer: Functions all relate to the same purpose
◍ Which elements are characteristic of a class diagram?.
Answer: System's classes, attributes, and methods and their features,
constraints, and relationships
◍ 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..
Answer: Declare variables distMiles and speedMphdistMiles = endLocation
- startLocationspeedMph = distMiles / timeHoursPut speedMph to output
,◍ What is put to output by the following pseudocode? x = 3do Put x to output
Put " " to output x = x - 1while x > 0.
Answer: 3 2 1
◍ What does the following algorithm determine?if x == y z = 1 else z = 0.
Answer: Whether x and y are the same
◍ A function calculates the weight difference (Diff) given two sample weights
(S1 and S2). What should be the output from the function?.
Answer: Diff
◍ 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.
Answer: At least one integer is negative
◍ What does the following algorithm accomplish? x = Get next input if x ==
-1 Put "Goodbye" to output.
Answer: Outputs Goodbye when user types -1
◍ Which phase of an agile approach would define a hypothesis to find a
problem in a program?.
Answer: Testing
◍ 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.
◍ Naming conventions.
Answer: A set of style guidelines defined by a company, team, teacher, etc.,
for naming variables.
◍ Arguments.
Answer: Any function input values, appear within ( ), and are separated by
commas if more than one.
◍ Given float x = 3.0. Which expression evaluates to 2.0?.
, Answer: x / 2 + 0.5 /2 + .25
◍ Interpreted Language.
Answer: A language that is run one statement at a time by another program
called an interpreter.
◍ Array.
Answer: An ordered list of items of a given data type.
◍ Statically typed.
Answer: Each variable's type must be declared and cannot change while the
program runs.
◍ Function F() Put "Hey" to output What entire output appears after three
successive calls to F()?.
Answer: HeyHeyHey
◍ Order the steps needed to output the minimum of x and y from first (1) to
last (4).A Declare variable minB Put min to outputC min = xD If y < min,
set min = y.
Answer: ACDB
◍ Dynamically typed.
Answer: A variable's type may change while a program executes, based on
what is assigned to the variable.
◍ Variables.
Answer: To refer to data, like x.
◍ 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
◍ Which characteristic specifically describes interpreted languages?.
Answer: They can run on any machine having the right interpreter.
◍ Characters.
Answer: Any letter (a-z, A-Z), digit (0-9), or symbol (~, !, @, etc.).