Tiểu luận tham khảo cho sinh viên - Tài liệu tham khảo | Đại học Hoa Sen

Tiểu luận tham khảo cho sinh viên - Tài liệu tham khảo | Đại học Hoa Sen và thông tin bổ ích giúp sinh viên tham khảo, ôn luyện và phục vụ nhu cầu học tập của mình cụ thể là có định hướng, ôn tập, nắm vững kiến thức môn học và làm bài tốt trong những bài kiểm tra, bài tiểu luận, bài tập kết thúc học phần, từ đó học tập tốt và có kết quả cao cũng như có thể vận dụng tốt những kiến thức mình đã họ

Advanced Programming Technique
Quiz
1. Abstract data types (ADTs) form the foundation for the concept of
a. int
b. class
c. array
d. float
2. Benefits of using ADTs:
a. you can’t hide implementation details
b. you can’t make the interface more informative
c. you don’t have to pass data all over your program
d. you aren’t able to work with real-world entities rather than with low-level implementation
structures
3. Reasons to create a class:
a. increase complexity
b. isolate complexity
c. expose implementation details
d. expose global data
4. Valid reasons to create a routine:
a. reduce complexity
b. allow duplicate code
c. worsen portability
d. reduce performance
5. Type of from low to high in routine design:cohesion
a. functional, sequential, communicational, temporal
b. temporal, functional, sequential, communicational
c. temporal, communicational, functional, sequential
d. temporal, communicational, sequential, functional
6. Type of from low to high in routine design:coupling
a. content, common, external, data
b. data, external, common, content
c. content, data, external, common
d. data, content, common, external
7. How to use routine parameters correctly?
a. put parameters in input-modify-output order
b. don’t use all the parameters passed
c. put status or error variables first
d. use routine parameters as working variables
8. How do you that you do expect to occur?handle errors
a. return a neutral value
b. call an error-processing routine/object (centralized)
c. display an error message (in the UI) wherever the error is encountered
d. all of the above
9. Defensive programming method includes:
a. error-handling techniques, protecting your program from valid inputs, assertions, exceptions
b. debugging aids, error-handling techniques, protecting your program from invalid outputs,
assertions
c. protecting your program from invalid inputs, assertions, error-handling techniques,
exceptions
d. assertions, error-handling techniques, protecting your program from valid outputs,
debugging aids
10. How many process of the pseudocodesteps in the “building classes and routines”
programming?
a. 2
b. 3
c. 4
d. 5
11. Order of steps in the “constructing routines” process of the pseudocode programming:
a. clean up loose ends, design the routine, code the routine, check the code
b. design the routine, clean up loose ends, code the routine, check the code
c. design the routine, code the routine, check the code, clean up loose ends
d. clean up loose ends, design the routine, code the routine, check the code
12. How many steps in the “code the routine” process of “constructing routines”?
a. 2
b. 3
c. 4
d. 5
13. The first and the second steps of the “design the routine” process in “constructing routines” are:
a. create a specification, check the prerequisites
b. create a specification, define the problem the routine will solve
c. check the prerequisites, create a specification
d. check the prerequisites, name the routine
14. The first and the second guidelines for avoiding initialization variables problems:
a. initialize each variable close to where it's first used, initialize each variable as it's declared
b. use final or const when possible, initialize a class's member data in its constructor
c. initialize each variable as it's declared, initialize each variable close to where it's first
used
d. initialize a class's member data in its constructor, use final or const when possible
15. One of the guidelines for minimizing variables scope :
a. favor the largest possible scope
b. don’t initialize variables used in a loop immediately before the loop
c. don’t assign a value to a variable until just before the value is used
d. none of the above
16. The second and the third guidelines for choosing good variables names:
a. choose good names for variables, make them easy to read
b. make them easy to read, make them understandable
c. don’t make them too long or too short, computed-value qualifiers in variable names
d. choose good names for variables, don’t make them too long or too short
17. How many kinds of guidelines for variables names to avoid?
a. 8
b. 9
c. 10
d. 11
18. The guideline kinds of variables names to avoid: for
a. avoid names with dissimilar meanings
b. avoid names that sound dissimilar
c. avoid numerals in names
d. none of the above
19. One of the guidelines for using numbers general in programing:
a. use "magic numbers"
b. don’t use hard-coded 0s and 1s if you need to
c. make type conversions obvious
d. use mixed-type comparisons
20. using integers in programing:One of the guidelines for
a. don’t check for integer division
b. don’t check for integer overflow
c. don’t check for overflow in intermediate results
d. none of the above
21. Which answer isn’t guideline for using arrays in programing?
a. make sure that all array indexes are within the bounds of the array
b. don’t check the end points of arrays
c. make sure indices of multidimensional arrays are used in the correct order
d. consider using containers instead of arrays
22. Reasons u se structures : to
a. use structures to simplify operations on blocks of data
b. use structures to simplify parameter lists
c. use structures to reduce maintenance
d. all of the above
23. Two wrong strategy with pointers: for working
a. work very hard to create correct code up front
b. detect pointer errors as soon after they are coded as possible
c. all of the above
d. none of the above
24. The guideline(s) for safer pointer use:
a. delete pointers at the same scoping level as they were allocated
b. don’t check pointers before using them
c. all of the above
d. none of the above
25. Global variables can only be accessed:
a. in a block of code
b. anywhere in a program
c. in a control loop
d. in a routine
26. How many s tatements in a specific order ? guidelines for
a. 3
b. 4
c. 5
d. 6
27. The guidelines s tatements in a specific order for
a. organize code to make dependencies less obvious
b. name routines to make dependencies less obvious
c. all of the above
d. none of the above
28. The guideline when writing if statements
a. write the nominal path through the code first then write the unusual cases
b. make sure that you branch correctly on equality using >= instead of > or <= instead of <
c. put the normal case after the rather than after the else if
d. use NULL then clauses
29. if-then-else chains?How many guidelines when writing such
a. 3
b. 4
c. 5
d. 6
30. Choosing the most effective ordering case statements effectively of cases for using :
a. order cases alphabetically or numerically
b. put the normal case first
c. order cases by frequency
d. all of the above
31. Tips using case statementsfor
a. Keep the action of each case simple
b. Use the default clause only to detect legitimate defaults
c. Use the default clause to detect errors
d. All of the above
32. How many loop types?
a. 3
b. 4
c. 5
d. 6
33. Which one is not a loop?
a. For
b. Forever
c. While
d. Do-while
34. Which loop has the test for exit at the end?
a. For
b. Foreach
c. While
d. Do-while
35. Which loop is the loop type “iterator loop”?
a. For
b. While
c. Foreach
d. Do-while
36. T for ips using recursion
a. Make sure the recursion stops, the safety counters to prevent infinite recursion
b. Limit recursion to one routine, keep an eye on the stack space
c. All of the above
d. None of the above
37. Which one is not the guideline for using gotos?
a. Use the goto when an equivalent built-in construct is available
b. Measure the performance of any goto used to improve efficiency
c. Make sure all goto labels are used
d. Make sure a goto doesn’t create unreachable code
38. table-driven code can beUsed in appropriate circumstances,
a. More complex than complicated logic
b. Easier to modify
c. Less efficient
d. All of the above
39. things up in using Table-Driven?How many methods of looking
a. 3
b. 4
c. 5
d. 6
40. Which one is not the method of looking things up in using Table-Driven?
a. Direct access
b. Indirect access
c. Indexed access
d. Stair-step access
41. Which one is not the guideline for Boolean expression?
a. Using 1 and 0 for Boolean tests
b. Making complicated expressions simple
c. Forming Boolean expressions positively
d. Using parentheses to clarify Boolean expression
42. deep nesting?How many ways for timing dangerously
a. 7
b. 8
c. 9
d. 10
43. How many components of structured programming?
a. 1
b. 2
c. 3
d. 4
44. The of isbenefit collaborative construction
a. To improve software quality
b. To increase development time
c. To turn higher development costs
d. None of the above
45. How many guidelines for pair programming (pair programming keys)?
a. 7
b. 8
c. 9
d. 10
46. benefits of pair programmingThe
a. It holds up better under stress than solo development
b. It worsens code quality
c. All of the above
d. None of the above
47. Which one is not a role during a formal inspection?
a. Moderator
b. Customer
c. Reviewer
d. Scribe
48. Order of steps in general procedure for an inspection:
a. Planning, preparation, overview, inspection meeting, inspection report
b. Overview, planning, preparation, inspection report, inspection meeting
c. Planning, overview, preparation, inspection meeting, inspection report
d. Overview, planning, preparation, inspection meeting, inspection report
49. Which one is not a kind of developer testing?
a. Unit testing
b. Binary testing
c. Component testing
d. System testing
50. In data in state:data-flow testing, can exist
a. Defined
b. Used
c. None of the above
d. All of the above
---------- ----------End
| 1/8

Preview text:

Advanced Programming Technique Quiz
1. Abstract data types (ADTs) form the foundation for the concept of a. int b. class c. array d. float 2. Benefits of using ADTs:
a. you can’t hide implementation details
b. you can’t make the interface more informative
c. you don’t have to pass data all over your program
d. you aren’t able to work with real-world entities rather than with low-level implementation structures 3. Reasons to create a class: a. increase complexity b. isolate complexity
c. expose implementation details d. expose global data
4. Valid reasons to create a routine:
a. reduce complexity b. allow duplicate code c. worsen portability d. reduce performance 5. Type of
from low to high in routine design: cohesion
a. functional, sequential, communicational, temporal
b. temporal, functional, sequential, communicational
c. temporal, communicational, functional, sequential
d. temporal, communicational, sequential, functional
6. Type of coupling from low to high in routine design:
a. content, common, external, data
b. data, external, common, content
c. content, data, external, common
d. data, content, common, external
7. How to use routine parameters correctly?
a. put parameters in input-modify-output order
b. don’t use all the parameters passed
c. put status or error variables first
d. use routine parameters as working variables
8. How do you handle errors that you do expect to occur? a. return a neutral value
b. call an error-processing routine/object (centralized)
c. display an error message (in the UI) wherever the error is encountered
d. all of the above
9. Defensive programming method includes:
a. error-handling techniques, protecting your program from valid inputs, assertions, exceptions
b. debugging aids, error-handling techniques, protecting your program from invalid outputs, assertions
c. protecting your program from invalid inputs, assertions, error-handling techniques, exceptions
d. assertions, error-handling techniques, protecting your program from valid outputs, debugging aids
10. How many steps in the “building classes and routines” process of the pseudocode programming? a. 2 b. 3 c. 4 d. 5
11. Order of steps in the “constructing routines” process of the pseudocode programming:
a. clean up loose ends, design the routine, code the routine, check the code
b. design the routine, clean up loose ends, code the routine, check the code
c. design the routine, code the routine, check the code, clean up loose ends
d. clean up loose ends, design the routine, code the routine, check the code
12. How many steps in the
“code the routine”
process of “constructing routines”? a. 2 b. 3 c. 4 d. 5
13. The first and the second steps of the “design the routine” process in “constructing routines” are:
a. create a specification, check the prerequisites
b. create a specification, define the problem the routine will solve
c. check the prerequisites, create a specification
d. check the prerequisites, name the routine
14. The first and the second guidelines for avoiding initialization variables problems:
a. initialize each variable close to where it's first used, initialize each variable as it's declared
b. use final or const when possible, initialize a class's member data in its constructor
c. initialize each variable as it's declared, initialize each variable close to where it's first used
d. initialize a class's member data in its constructor, use final or const when possible
15. One of the guidelines for minimizing variables scope : a. favor the la
rgest possible scope
b. don’t initialize variables used in a loop immediately before the loop
c. don’t assign a value to a variable until just before the value is used d. none of the above
16. The second and the third guidelines for choosing good variables names:
a. choose good names for variables, make them easy to read
b. make them easy to read, make them understandable
c. don’t make them too long or too short, computed-value qualifiers in variable names
d. choose good names for variables, don’t make them too long or too short 17. How many
guidelines for kinds of
variables names to avoid? a. 8 b. 9 c. 10 d. 11
18. The guideline
for kinds of variables names to avoid:
a. avoid names with dissimilar meanings
b. avoid names that sound dissimilar
c. avoid numerals in names d. none of the above
19. One of the guidelines for using numbers general in programing: a. use "magic numbers"
b. don’t use hard-coded 0s and 1s if you need to
c. make type conversions obvious d. use mixed-type comparisons
20. One of the guidelines for using integers in programing:
a. don’t check for integer division
b. don’t check for integer overflow
c. don’t check for overflow in intermediate results
d. none of the above
21. Which answer isn’t guideline for using arrays in programing?
a. make sure that all array indexes are within the bounds of the array
b. don’t check the end points of arrays
c. make sure indices of multidimensional arrays are used in the correct order
d. consider using containers instead of arrays 22. Reasons
to u se structures :
a. use structures to simplify operations on blocks of data
b. use structures to simplify parameter lists
c. use structures to reduce maintenance
d. all of the above 23. T
wo wrong strategy for working with pointers:
a. work very hard to create correct code up front
b. detect pointer errors as soon after they are coded as possible
c. all of the above d. none of the above
24. The guideline(s) for safer pointer use:
a. delete pointers at the same scoping level as they were allocat ed
b. don’t check pointers before using them c. all of the above d. none of the above
25. Global variables can only be accessed: a. in a block of code
b. anywhere in a program c. in a control loop d. in a routine 26. How many
guidelines for s tatements in a specific o rder ? a. 3 b. 4 c. 5 d. 6
27. The guidelines
for s tatements in a specific order
a. organize code to make dependencies less obvious
b. name routines to make dependencies less obvious c. all of the above
d. none of the above
28. The guideline when writing if statements
a. write the nominal path through the code first then write the unusual cases
b. make sure that you branch correctly on equality using >= instead of > or <= instead of <
c. put the normal case after the rather than after the else if d. use NULL then clauses 29.
if-then-else chains?
How many guidelines when writing such a. 3 b. 4 c. 5 d. 6
30. Choosing the most effective ordering of cases for using case statements effectively:
a. order cases alphabetically or numerically b. put the normal case first c. order cases by frequency
d. all of the above 31. T
ips for using case statements
a. Keep the action of each case simple
b. Use the default clause only to detect legitimate defaults
c. Use the default clause to detect errors
d. All of the above
32. How many loop types? a. 3 b. 4 c. 5 d. 6 33. Which one is not a loop? a. For b. Forever c. While d. Do-while
34. Which loop has the test for exit at the end? a. For b. Foreach c. While d. Do-while
35. Which loop is the loop type “iterator loop”? a. For b. While c. Foreach d. Do-while 36. T for ips using recursion
a. Make sure the recursion stops, the safety counters to prevent infinite recursion
b. Limit recursion to one routine, keep an eye on the stack space
c. All of the above d. None of the above
37. Which one is not the guideline for using gotos?
a. Use the goto when an equivalent built-in construct is available
b. Measure the performance of any goto used to improve efficiency
c. Make sure all goto labels are used
d. Make sure a goto doesn’t create unreachable code
38. Used in appropriate circumstances, table-driven code can be
a. More complex than complicated logic
b. Easier to modify c. Less efficient d. All of the above 39.
things up in using T How many methods of looking able-Driven? a. 3 b. 4 c. 5 d. 6
40. Which one is not the method of looking things up in using Table-Driven? a. Direct access
b. Indirect access c. Indexed access d. Stair-step access
41. Which one is not the guideline for Boolean expression?
a. Using 1 and 0 for Boolean tests
b. Making complicated expressions simple
c. Forming Boolean expressions positively
d. Using parentheses to clarify Boolean expression
42. How many ways for timing dangerously deep nesting? a. 7 b. 8 c. 9 d. 10
43. How many components of structured programming? a. 1 b. 2 c. 3 d. 4
44. The benefit of is
collaborative construction a. T
o improve software quality
b. To increase development time
c. To turn higher development costs d. None of the above
45. How many guidelines for pair programming (pair programming keys)? a. 7 b. 8 c. 9 d. 10 46.
benefits of pair programming The
a. It holds up better under stress than solo development b. It worsens code quality c. All of the above d. None of the above
47. Which one is not a role during a formal inspection? a. Moderator b. Customer c. Reviewer d. Scribe
48. Order of steps in general procedure for an inspection:
a. Planning, preparation, overview, inspection meeting, inspection report
b. Overview, planning, preparation, inspection report, inspection meeting
c. Planning, overview, preparation, inspection meeting, inspection report
d. Overview, planning, preparation, inspection meeting, inspection report
49. Which one is not a kind of developer testing? a. Unit testing
b. Binary testing c. Component testing d. System testing
50. In data-flow testing, data in state: can exist a. Defined b. Used c. None of the above
d. All of the above ---------- End ----------