Preview

Computer Science Homework Chapter 3

Better Essays
Open Document
Open Document
1580 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Computer Science Homework Chapter 3
Multiple Choice
1) Module
2) Divide and Conquer
3) Header
4) Call
5) Return
6) Top-down Design
7) Flowchart
8) Local Variable
9) Scope
10) Argument
11) Parameter
12) By Value
13) By Reference
14) Global variable
15) Global

True or False
1) False
2) True
3) True
4) False
5) True
6) False
7) False
8) True
9) True
10) False
11) True
12) False

Short Answers
1) You can call the module several times instead of writing it out each time.
2) The header is the starting point and the body is a list of statements that belong to the module.
3) It will return back to its previous point in the program.
4) A local variable is declared inside the module only. Only the statements inside the module can access it.
5) A local variable’s scope begins at the variable’s declaration and ends at the end of the module in which the variable is declared.
6) When you pass by value you pass a copy. When you pass by reference, you can modify the contents.
7) Global variables make debugging difficult because any statement in a program can change its value.

Algorithm Workbench
1) Module timesTen(Integer value)
Declare Integer result
Set result = * 10
Display result
End Module

2) Examine the following pseudocode module header, and then write a statement that calls the module, passing 12 as an argument.

Module showValue( Integer quantity)

Module main()
Call showValue (12)
End Module

3) Look at the following pseudocode module header: Module myModule( Integer a, Integer b, Integer c) Now look at the following call to myModule: Call myModule( 3, 2, 1) When this call executes, what value will be stored in a? What value will be stored in b? What value will be stored in c?

A=3
B=2
C=1

4) Assume that a pseudocode program contains the following module: Module display( Integer arg1, Real arg2, String arg3) Display " Here are the values:" Display arg1, " ", arg2, " ", arg3 End Module
Assume that the same program has a main

You May Also Find These Documents Helpful

  • Satisfactory Essays

    A local variable is declared inside a module and cannot be accessed by statements that are outside the module.…

    • 765 Words
    • 5 Pages
    Satisfactory Essays
  • Powerful Essays

    2. Using a similar approach as the example provided in section 2.2(textbook page 78) for “The Sale Price Program continued”, provide your program design for the program you analyzed for calculating the number of square feet in a house. Be sure to describe the fundamental tasks needed to solve the problem so you can use a modular design. Provide pseudocode of your overall design that includes the Main module and the order of the module calls (see page 82 for an example). Finally, list all of your pseudocode for each module (See example 2.6 on page 83 as an example).…

    • 832 Words
    • 4 Pages
    Powerful Essays
  • Satisfactory Essays

    This week learning assignment is based on Unit 8 Chapter 6 reading of the textbook about the elements of a computing system that focus on the selections relevant for supporting programs with symbols.…

    • 288 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    5) Exceptions are related to application where as Errors are related to environment in which application is running.…

    • 559 Words
    • 3 Pages
    Good Essays
  • Good Essays

    This paper will describe the variable naming rules of three different programming languages. These three languages are Visual Basic, Python, and Java. Each of these languages has different rules that apply to them and some similarities. I will describe the rules and the similarities and differences in the next few paragraphs.…

    • 878 Words
    • 4 Pages
    Good Essays
  • Powerful Essays

    IT/210 Appendix D

    • 453 Words
    • 4 Pages

    Up to this point, you have identified the processes the program must perform, but you have not given any consideration to exactly how the processes work together to solve the problem. At this point, you must generate a description of the processing using pseudocode, a natural language description of the processing the application must perform.…

    • 453 Words
    • 4 Pages
    Powerful Essays
  • Satisfactory Essays

    Unit 4 Homework

    • 401 Words
    • 2 Pages

    Not Sure what is going to happen because I wrote that whole program and nothing happen. The Value is passed into the parameter value on this program module though.…

    • 401 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    While making a program in .NET for commercial usages, there are many methods which are used to prevent reverse engineering and unauthorized usage of that particular program. While keeping the code 's functionality intact, the obfuscation methodology changes the coding in such a way that it becomes quite difficult even with tools to reverse engineer. Remember it becomes difficult not impossible to reverse engineer an obfuscated code. There are numerous ways and means to…

    • 793 Words
    • 4 Pages
    Good Essays
  • Good Essays

    Comp 220

    • 1463 Words
    • 6 Pages

    Pointers also have the requirement that the pointer type must be of the same data type as the variable, or the data that it points to or holds the address of. The power of pointers also hints at the potential complexity of their use, which is why this lab is focused almost entirely on several different aspects and uses of pointers. The lab also introduces pointer arrays and pointers to pointers.…

    • 1463 Words
    • 6 Pages
    Good Essays
  • Satisfactory Essays

    cmis 102 HW 2

    • 748 Words
    • 6 Pages

    In this program, I will be using various variables with different definitions. The table below will list and identify the variables:…

    • 748 Words
    • 6 Pages
    Satisfactory Essays
  • Good Essays

    4. Find at least one use of parallel structure in the Declaration. What key terms are repeated in identical or equivalent constructions, and to what effect?…

    • 695 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    A Procedural programming module is function, procedure, subprogram or subroutine within a program designed for a specific purpose and only does that one job (Haas, 2011). For outside programmers looking in these are relatively easy to follow and decipher when looked into. Procedural programming modules are most often written in the order they are intended to be executed with the exception of those called upon again later in the program. Modules of this type are good for reuse in the original program because they were designed for that program, but they are not very good for reuse in other programs without heavy modification because they were designed to do a specific task for a specific program, and that does not leave much room for flexibility. Variables can be declared as local within a module and will be exclusive to that module. There is also the ability to create local variables within a given module but you have to remember to pass the correct data in and out using global variables, and they must be declared properly to work right. Considering the preceding, the use of procedural programming modules is an excellent approach to many programming problems…

    • 729 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Object Oriented Programming

    • 41750 Words
    • 167 Pages

    Ans: Assignment can be done as many times as desired whereas initialization can be done only once.…

    • 41750 Words
    • 167 Pages
    Satisfactory Essays
  • Powerful Essays

    3: Branch, Call, and Time Delay Loop 4: AVR I/O Port Programming 5: Arithmetic, Logic Instructions,…

    • 60899 Words
    • 244 Pages
    Powerful Essays
  • Good Essays

    C Interview questions and Answers | NEW Subjective Interview questions Here are few examples of standard subjective oral questions asked in C interviews. Note how the questions are interrelated and how difficulty of questions increases as interview moves on. A mediocre student will perhaps give up after three or four questions and only those who have clear knowledge of concepts related to C language will make till the last question. I recommend reading online forums, books like c loops and pitfall and experimentation with your code for clear knowledge of C concepts.…

    • 546 Words
    • 3 Pages
    Good Essays