






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!







โ 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. โ Which characteristic specifically describes interpreted languages? Answer: They can run on any machine having the right interpreter. โ 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
โ Which operator should be used to determine if a number is evenly divisible by 5? Answer: % โ 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?
โ Which data type should be used to keep track of how many planes are in a hangar? Answer: Integer โ 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 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?
โ 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). 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). 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 Answer: Whether x and y are the same โ What does the following algorithm accomplish? x = Get next input; if x == - 1; Put "Goodbye" to output Answer: 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 Answer: At least one integer is negative.
โ When should a programmer develop an algorithm to solve a problem? Answer: Before writing a program to solve the problem โ Which text represents an algorithm? Answer: Insert key, turn key, open door. โ Which text represents an algorithm? Answer: 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? Answer: Input 99, 0, 5. Ensure output is "Not OK." โ What is put to output by the following flowchart, if the input is 17? Answer: OK โ What is put to output by the following flowchart, if the input is 3 5
Answer: Analysis โ 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 โ 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? Answer: Implementation โ