Computer Science Homework Chapter 3

Better Essays
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

    Chapter 3 Homework

    • 1290 Words
    • 6 Pages

    revenue in the period in which we earn it. | | | 2. | | Discuss the major principle that describes recording expenses.The matching principle states that we recognize expenses in the same period as the revenues they help to generate. | | LO1 | 3. | | Samantha is a first-year accounting student. She doesn't think it matters that expenses are reported in the same period's income statement with the related revenues (matching principle). She feels that “as long as revenues and expenses are recorded…

    • 1290 Words
    • 6 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Chapter 3 Homework 1

    • 3486 Words
    • 77 Pages

    AssignmentPrint View 4 t . Page1 of26 it11'"," i. Oepreciation for 2011is computed to be $1O,OOO. on the company's equipment beforeadjusting b. The PrepaidInsurance accounthad a $6,000debitbalanceat December31,2011, for the costsof any expiredcoverage. An analysisof the company'sinsurancepoliciesshowedthat insurance coverageremains. $720of unexpired c. The OfficeSuppliesaccounthad a $570debitbalanceon December31,2010; and $2,680of office supplieswere purchasedduringthe year.The December31,2011…

    • 3486 Words
    • 77 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Homework 1 – GMGT 590 Q 3.5 | Step 1: Cut | Step 2: Put Grilled Stuff on Bagel | Step 3: Veggies on Bagel | Step 4: Cream Cheese | Step 5: Wrap | I | 1 | 1 | 1 | 1 | 1 | T | 3 min | 10 min | 5 min | 4 min | 2 min | R | 0.333333333 | 0.1 | 0.2 | 0.25 | 0.5 | % | 100% | 16.67% | 77.78% | 22.20% | 100% | ADJ R | 0.333333333 | .5999 | 0.2571 | 1.126 | 0.5 | | | | | | | Total Bagel | 180 | 100.00% | | | | Grilled Veggie | 30 | 16.67% | | | | Veggie Only |…

    • 1341 Words
    • 6 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Workshop 1 – Chapters 1-3 Exercise 2-2 (15 minutes) | | Product Cost | Period Cost | 1. | The cost of the memory chips used in a radar set | X | | 2. | Factory heating costs | X | | 3. | Factory equipment maintenance costs | X | | 4. | Training costs for new administrative employees | | X | 5. | The cost of the solder that is used in assembling the radar sets | X | | 6. | The travel costs of the company’s salespersons | | X | 7. | Wages and salaries…

    • 1365 Words
    • 6 Pages
    Satisfactory Essays
  • Good Essays

    Homework 3

    • 459 Words
    • 2 Pages

    (* Coursera Programming Languages, Homework 3, Provided Code *) exception NoAnswer datatype pattern = Wildcard | Variable of string | UnitP | ConstP of int | TupleP of pattern list | ConstructorP of string * pattern datatype valu = Const of int | Unit | Tuple of valu list | Constructor of string * valu fun g f1 f2 p = let val r = g f1 f2 in case p of Wildcard => f1 () | Variable x => f2 x | TupleP…

    • 459 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    Homework 3

    • 671 Words
    • 3 Pages

    Finance Capstone Advanced Topics Homework Three AIJIA ZHOU The general information of the two bonds are shown below: Coupon | 10.625% | 4.25% | Coupon frequency | Semi-annual | Semi-annual | Coupon type | Fixed | Fixed | Day count | Act/Act | Act/Act | Issue date | August 15, 1985 | August 15, 2005 | Maturity date | August 15, 2015 | August 15, 2015 | Amount issued | 7.15 billion | 32.47 billion | Amount outstanding | 4.02 billion | 32.47 billion | Modified Duration Method…

    • 671 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Homework 3

    • 5294 Words
    • 119 Pages

    10/13/12 Assignment Print View Score: 45.94 1. out of 50 points (91.88%) aw ard: 10 out of 10.00 points Chapman Company obtains 100 percent of Abernethy Company’s stock on January 1, 2011. As of that date, Abernethy has the following trial balance: Debit Accounts payable Accounts receivable Additional paid-in capital Buildings (net) (4-year life) Cash and short-term investments Common stock Equipment (net) (5-year life) Inventory Land Long-term liabilities (mature…

    • 5294 Words
    • 119 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Homework 3

    • 830 Words
    • 4 Pages

    System: Neuromuscular Junction 1. What insulates each muscle cell? __________endomysium_______________ 2. Synaptic vesicles in the axon terminal of a motor neuron contain what neurotransmitter? __________acetylcholine_______________ 3. An action potential in the axon terminal of a motor neuron opens what type of ion channels? ____________Voltage-gated Calcium_____________ 4. By what means of membrane transport does the neurotransmitter leave the axon terminal? ____________exocytosis_____________…

    • 830 Words
    • 4 Pages
    Satisfactory Essays
  • Good Essays

    homework 3

    • 971 Words
    • 4 Pages

    University of Phoenix Material How Films Communicate Instructions Complete and submit Part I in your first week of class. In Week Two, complete Parts II & III after viewing a film of your choice from the University of Phoenix Material: How Films Communicate Film List located under your Week One materials. Submit your completed worksheet in Week Two. Part I: Beginning to Analyze Film To compete Part I, choose a movie you have viewed in the past (this does not have to be from the University…

    • 971 Words
    • 4 Pages
    Good Essays
  • Satisfactory Essays

    Chapter 10 Homework

    • 287 Words
    • 2 Pages

    Chapter 10 – Photosynthesis – Homework 1. Write the basic equation for Photosynthesis (Ps). 2. Some students define Ps as the process by which plants use light energy as food. Discuss if this is a correct statement that would likely be accepted by an AP Biology Exam Reader. 3. Contrast and compare an absorption spectra versus an action spectra for Ps. 4. Discuss why is the narrow area of electromagnetic radiation between 380-750 nm is the best choice to power a process like Ps…

    • 287 Words
    • 2 Pages
    Satisfactory Essays