Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1 What does a programmer do during the analysis phase of software development? a

ID: 3663732 • Letter: 1

Question

1 What does a programmer do during the analysis phase of software development? a Codes the program in a particular programming language b Writes the algorithms for solving a problem c Decides what the program will do and determines its user interface d Tests the program to verify its correctness

2 What must a programmer use to test a program? a All possible sets of legitimate inputs b All possible sets of inputs c A single set of legitimate inputs d A reasonable set of legitimate inputs

3 What must you use to create a multi-line string? a A single pair of double quotation marks b A single pair of single quotation marks c A single pair of three consecutive double quotation marks d Embedded newline characters

4 What is used to begin an end-of-line comment? a / symbol b # symbol c % symbol

5 Which of the following lists of operators is ordered by decreasing precedence? a +, *, ** b *, /, % c **, *, +

6 The expression 2 ** 3 ** 2 evaluates to which of the following values? a 64 b 512 c 8

7 The expression round(23.67) evaluates to which of the following values? a 23 b 23.7 c 24.0

8. Assume that the variable name has the value 33. What is the value of name after the assignment statement name = name * 2 executes? a 35 b 33 c 66

9. Write an import statement that imports just the functions sqrt and log from the math module.

10. What is the purpose of the dir function and the help function?

Explanation / Answer

1 What does a programmer do during the analysis phase of software development? a Codes the program in a particular programming language b Writes the algorithms for solving a problem c Decides what the program will do and determines its user interface d Tests the program to verify its correctness

2 What must a programmer use to test a program? a All possible sets of legitimate inputs b All possible sets of inputs c A single set of legitimate inputs d A reasonable set of legitimate inputs

3 What must you use to create a multi-line string? a A single pair of double quotation marks b A single pair of single quotation marks c A single pair of three consecutive double quotation marks d Embedded newline characters

4 What is used to begin an end-of-line comment? a / symbol b # symbol c % symbol

5 Which of the following lists of operators is ordered by decreasing precedence? a +, *, ** b *, /, % c **, *, +

6 The expression 2 ** 3 ** 2 evaluates to which of the following values? a 64 b 512 c 8

7 The expression round(23.67) evaluates to which of the following values? a 23 b 23.7 c 24.0

8. Assume that the variable name has the value 33. What is the value of name after the assignment statement name = name * 2 executes? a 35 b 33 c 66

9. Write an import statement that imports just the functions sqrt and log from the math module.

10. What is the purpose of the dir function and the help function?

ANSWERS

1)Decides what the program will do and determines its user interface

2)All possible sets of inputs

3)A single pair of three consecutive double quotation marks

4)# symbol

5)**, *, +

6)64

7)24.0

8)66

9)

from math import sqrt

from math import log

10)

Dir function

Without arguments, return the list of names in the current local scope. With an argument, attempt to return a list of valid attributes for that object.

If the object has a method named __dir__(), this method will be called and must return the list of attributes. This allows objects that implement a custom __getattr__() or __getattribute__() function to customize the way dir() reports their attributes.

Help function

Invoke the built-in help system. (This function is intended for interactive use.) If no argument is given, the interactive help system starts on the interpreter console. If the argument is a string, then the string is looked up as the name of a module, function, class, method, keyword, or documentation topic, and a help page is printed on the console. If the argument is any other kind of object, a help page on the object is generated.