


























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A pre-assessment exam for a scripting and programming foundations course. It includes actual questions with verified answers, covering topics such as agile development phases, programming libraries, dynamically and statically typed languages, object-oriented design principles, compiled and interpreted languages, markup languages, operators, data types, functions, and control structures. This resource is useful for students preparing for the exam or seeking to reinforce their understanding of fundamental programming concepts. The questions are designed to test knowledge and application of key concepts in scripting and programming.
Typology: Exams
1 / 34
This page cannot be seen from the preview
Don't miss anything!



























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? A Analysis B Design C Implementation D Testing - correct answer - 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? A Analysis B Design C Implementation D Testing - correct answer - Implementation What does a programmer do first to use an existing programming library? A Write the library's functions B Modify the library's functions C Include the library D Discard the library - correct answer - Include the library What relationship is common among a programming library's functions? A Functions all relate to the same purpose.
Which language is not built on object-oriented design principles? A C B C++ C Java D Python - correct 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? A Dynamically typed B Object-oriented C Markup D Statically typed - correct 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? A Dynamically typed B Object-oriented C Markup D Statically typed - correct 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? A Objects B Compiler C Script D Markup - correct answer - Markup
C They use memory more efficiently. D They create a separate file. - correct answer - They can be modified at run time. Which characteristic specifically describes a markup language? A Tags surround text to describe desired formatting. B A program's execution marks output with numbers and strings. C A compiler marks statements with 0's and 1's. D An interpreter executes statements one at a time. - correct answer - Tags surround text to describe desired formatting. Which characteristic specifically describes interpreted languages? A They are written using pseudocode. B They consist of a set of functions and objects. C They can be run one statement at a time. D They are converted to 0's and 1's. - correct answer - They can be run one statement at a time.
Which characteristic specifically describes interpreted languages? A They are drawn out using graphical diagrams. B They can run on any machine having the right interpreter. C They are compiled to machine code before being executed. D They substantially support decomposing a program into objects. - correct answer - They can run on any machine having the right interpreter. Which operator should be used to determine if a number is evenly divisible by 5? A + B - C * D % - correct answer - % A car drove 200 miles using 10 gallons of fuel.
B Float array C String array D Boolean array - correct 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? A Constant float userTime B Variable float userTime C Constant integer secondsPerMinute D Variable integer secondsPerMinute - correct 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? A Constant integer minAge
B Variable integer minAge C Constant integer 35 D Variable integer 35 - correct answer - Constant integer minAge Given integer x = 3 and integer y = 5. What is the value of the expression ( x / 2.0) + y? A 5. B 6. C 6. 7 7.5 - correct answer - 6. Given float x = 10.2 and float y = 1.0. What is the value of the expression x / y? A 0. B 1. C 10 D 10.2 - correct answer - 10.
D x / 2 + 0.5 /2 + .25 - correct answer - X/2+0.5/2+0. Which expression evaluates to true only when the user is within 3 years of 21 years, given a variable x containing a user's age? A x >= 18) or ( x <= 24) B ( x >= 18) and ( x <= 24) C ( x < 18) or ( x > 24) D ( x < 18) and ( x > 24) - correct answer - (X>=18) and (X<=24) Which data type is used for items that are measured in length? A Integer B Float C String D Boolean - correct answer - Float Which data type should be used to keep track of how many planes are in a hangar? A Integer B Float
C String D Boolean - correct 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? A Hours only B Minutes only C Hours and minutes D Hours, minutes, and seconds - correct 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? A x B x, x C x, x, x D 27 - correct answer - X
Function F() Put "Hey" to output What entire output appears after three successive calls to F()? A Hey B HHHey C HeyHeyHey D Hey Hey Hey - correct answer - HeyHeyHey What is a valid user-defined function name? A A reserved word B Any valid identifier C Any variable name D A floating-point number - correct answer - Any valid identifier A function MyFct has an input x and an output z. What does MyFct return?
A Nothing B x only C z only D x and z - correct answer - Z only What is the return value of a function? A Output of a function B Call to run the function C Data passed to the function D Variable in the declaration of the function - correct 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? A If statement B For loop C Multiple if statements D While loop - correct answer - While loop
while x > 0 A 3 2 1 0 B 3 2 1 0 - 1 C 2 1 0 D 3 2 1 - correct answer - 321 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? A 'Hello' will print four times. B 'Hello' will print five times. C The program will throw an error. D 'Hello' will print indefinitely. - correct answer - '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 A i B i<20 /> C i = 0 D i = i + 1 - correct answer - i<20/> 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