PROGRAMMING CERTIFICATION SCRIPT
2026 QUESTIONS WITH SOLUTIONS
GRADED A+
◍ What is an advantage of interpreted programs?.
Answer: they can be modified at run time
◍ Function F() Put "Hey" to output What entire output appears after three
successive calls to F()?.
Answer: HeyHeyHey
◍ What does the length property of an array return?.
Answer: The number of elements in the array;
◍ 8. In which sections of an HTML document can you embed JavaScript
code?.
Answer: The <head> and/or the <body> sections
◍ 16. A JavaScript rule concerning variables states that the first character of a
variable name must be:.
Answer: a letter the underscore character ( _ ) or the dollar sign ( $ ).
◍ Consider the following statement:src="script.js" In programming terms what
is the text "script.js" called?.
Answer: A value or "script.js" is a *string literal or filename*, not just a
generic "value."
◍ What is put to output by the following flowchart, if the input is 17?.
Answer: OK
◍ Which SDLC model emphasizes iterative development and frequent
, customer feedback?.
Answer: Agile
◍ What does the slice(1, 3) method return for ["a", "b", "c", "d"]?.
Answer: ["b", "c"]
◍ 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
◍ What is the purpose of the else if clause?,.
Answer: To test additional conditions when the initial if is false;
◍ A programmer has developed the following code: count = 0while count is
less than 5: print 'Hello' What is the result of implementing this code?.
Answer: 'Hello' will print indefinetly
◍ What is the result of the expression "true && false" in JavaScript?.
Answer: false
◍ 10. Between which tag pair should you reference an external .js file in your
HTML document when you want to add JavaScript from an external text
file?.
Answer: The <script></script> tag pair
◍ What does the splice() method do to an array?.
Answer: Adds or removes elements at a specific index
◍ What is the purpose of CSS in web development?.
Answer: To style and format HTML elements;
◍ What is the correct way to declare an array with three elements?,.
Answer: let colors = ["red", "green", "blue"];;
◍ What does the pop() method do to an array?.
Answer: Removes the last element from the array;
◍ Which phase of a waterfall approach defines a program's goals?.
Answer: analysis
, ◍ What does the unshift() method do to an array?.
Answer: Adds one or more elements to the beginning of the array;
◍ An algorithm should output "OK" if a list's numbers are all non-zero, else
the output is "Not O
K. " Which test is a valid test of the algorithm?.
Answer: Input 99, 0, 5. Ensure output is "Not OK."
◍ 11. How should you embed JavaScript code in an HTML5 document to
which you are also linking an external JavaScript file?.
Answer: You can use a single `<script>` tag with a `src` attribute for
external files. Inline scripts can be added separately but aren't required
◍ 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
◍ Which data type should be used to keep track of how many planes are in a
hangar?.
Answer: integer
◍ What is the purpose of the return statement in a function?.
Answer: To send a value back to the caller
◍ What is the main goal of the Maintenance phase?.
Answer: To fix bugs and update features post-deployment;
◍ What is the scope of a variable declared with `let` inside a block?.
Answer: Block scope;
◍ 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
◍ 3. What step should you take to ensure that your JavaScript code runs as
expected?.
Answer: Test your code in various browsers.