Quiz 1

docx

School

New York University *

*We aren’t endorsed by this school

Course

4513

Subject

Computer Science

Date

Feb 20, 2024

Type

docx

Pages

10

Uploaded by ara21059

Report
1. According to PEP 8, constants should...? 1. BE_IN_ALL_CAPS 2. beInCamelCase 3. be_defined_with_underscores 4. be defined on a per project basis 2. Modularizations include design decisions which must be made...? 1. after the workable system has been built 2. before the work on independent modules begins 3. any old time 4. dependent on the module in question 3. In the first modular decomposition described in the paper on "decomposing systems into modules", the criterion used was...? 1. to make each major step in the processing a module 2. to compress the functionality of a program to as few modules as possible 3. to increase interdependence between modules as much as possible 4. the first decomposition did not rely on using separate modules 4. A spark plug is a good example of a modular component, since when you have to replace one, _____.
1. when you have to change one, many other parts of the engine have to be changed as well. 2. you just unplug the old one and plug in the new one. 3. they are low in price. 4. all of the above 5. Each module in modular decomposition should be...? 1. dependent on other modules 2. responsible for multiple parts of a program 3. be as large as possible 4. small and simple enough 6. Function and variable names should be...? 1. as short as possible 2. as long as possible 3. hitting the mean between very short and very long 4. in all upper case 7. According to PEP 8, if we need a line break near a binary operator, it should come...? 1. after the operator 2. before the operator 3. wherever looks good 4. nowhere: rewrite the code so you don't need it 8. In modularization, the data structure, with its accessing and modifying procedures, should...? 1. be reused by different modules
2. be shared by all modules within the same class 3. be shared by many modules within a program 4. be a part of single module 9. To mitigate our poor ability to visualize processes evolving in time the programmers should...? 1. rely exclusively on static processes 2. shorten the conceptual gap between the static program and the dynamic process 3. manage the complexity of dynamic processes 4. use dynamic visualization tools 10. The main consequence of using the "go to" statements is...? 1. they create too much repetition within our program 2. it is hard to implement them on a modern day equipment 3. they prevent us from effectively using recursive procedures within our program 4. it becomes hard to find meaningful set of coordinates in which to describe the progress of a process 11 PEP 8 recommends that when indenting, we should use..? 1. tabs 2. spaces
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
3. underscores 4. asterisks 12 Comments should be...? 1. employed only when necessary 2. scattered through the code as widely as possible 3. used for every line of code 4. never used at all 13 If our program employs a database, we should define the data tables...? 1. in our code 2. in the database 3. in both the code and database 4. in one place used by both our code and the database 14 Adding # noqa to the Python line will... 1. prevent Python linter from checking the line 2. force Python linter to check the line 3. do nothing, since it's just a comment 4. none of the above 15 Our primary tactic for making our programs easy to change and understand is...? 1. modifications 2. mollification
3. modularity 4. mortification 16 When it comes to naming variables, we should...? 1. always use camel case 2. always employ underscores 3. keep everything in ALL Caps 4. use the convention most widespread in our coding language 17 Dijkstra, in "Goto considered harmful," claims that the programmer does NOT have control over...? 1. the values of textual and dynamic indices 2. repetition clauses within the program 3. recursive procedures within the program 4. none of the above 18 DRY means your code should ...? 1. not be all wet 2. Delete Random Years 3. Dally Really Youthfully 4. not repeat itself 19 You should test your program...? 1. only when completely done 2. after every few lines of code you write
3. never: that is the job of the testers 4. rarely: testing wastes time you should be using to code 20 Linting means...? 1. merging different parts of the projects 2. stylistically checking the quality of the code 3. testing the functionality of the program 4. both B and C 21 Our functions should...? 1. precisely embody the mathematical notion of a function 2. do as many tasks as possible, since functions calls take time 3. do one clearly definable task 4. none of the above 22 The most important reason to use consistent indentation is...? 1. it makes it easy for readers to see the control blocks 2. to pass the tests of code-style tools 3. it looks prettier that way 4. all of the above 23 The Flake8 is a...? 1. version control system 2. linter for React 3. C++ compiler
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
4. linting tool for Python 24 "No magic constants" means you should not...? 1. scatter constants like 7, 12, or 3.14 through your program 2. define constants to have values like "Harry Potter" 3. use integer values in your code 4. use an irrational number in your code 25 The progress of a process can be uniquely characterized by...? 1. a textual indices 2. recursive procedures 3. repetition clauses 4. a mixed sequence of textual and/or dynamic indices 26 In the second modular decomposition described in the paper, the criterion used was...? 1. to increase dependency between different modules compared to the first decomposition 2. to have as much processing done in the Alphabetizer module 3. information hiding 4. flowchart 27 Interfaces between modules should be...? 1. narrow and well-defined 2. broad and consistent 3. narrow and vague
4. free form 5. non-existent 28 To mitigate our poor ability to visualize processes evolving in time the programmers should...? 1. rely exclusively on static processes 2. shorten the conceptual gap between the static program and the dynamic process 3. manage the complexity of dynamic processes 4. use dynamic visualization tools 29 The interface to a module should _____. 1. change as infrequently as possible 2. be altered whenever anything inside the module changes 3. connect to as many components outside the module as possible 4. consist of zero connections to other modules 30 The best way to make your code understandable is...? 1. to use as many comments as possible 2. to use the longest variable names possible 3. to write clear code 4. none of the above 31 We need independent coordinates in which to describe the progress of a process because...? 1. this helps us to visualize processes evolving in time
2. we can interpret the value of a variable only with respect to the progress of a process 3. this is a way to shorten the gap between the static program and dynamic process 4. this helps us to avoid the use of go to statements 32 An important feature of modular programming is...? 1. to allow one module to see all data in another module 2. to allow modules to access as much of the code in other modules as possible 3. to allow one module to be coded with little knowledge of how other modules are coded 4. all of the above 33 The main consequence of using the "go to" statements is...? 1. they create too much repetition within our program 2. it is hard to implement them on a modern day equipment 3. they prevent us from effectively using recursive procedures within our program 4. it becomes hard to find meaningful set of coordinates in which to describe the progress of a process 34 In the first modular decomposition described in the paper on "decomposing systems into modules", the criterion used was...?
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
1. to make each major step in the processing a module 2. to compress the functionality of a program to as few modules as possible 3. to increase interdependence between modules as much as possible 4. the first decomposition did not rely on using separate modules 35 We need more software engineering as we increase 1. the number of programmers 2. the amount of code 3. the time the project will last 4. all of the above