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
…show more content…
Module main() call salesTax
End Module
Module salesTax(Integer Value)
Declare Integer tax
Set tax = value * 0.02 * 0.04
Display tax
End Module
3. How Much Insurance? Many financial experts advise that property owners should insure their homes or buildings for at least 80 percent of the amount it would cost to replace the structure. Design a modular program that asks the user to enter the replacement cost of a building and then displays the minimum amount of insurance he or she should buy for the property.
Module main()
Call amount
Display cost
End Module
Module amount
Declare Integer cost
Display “Enter price”
Set cost = value * .80
End Module
4. Automobile Costs Design a modular program that asks the user to enter the monthly costs for the fol-lowing expenses incurred from operating his or her automobile: loan payment, in-surance, gas, oil, tires, and maintenance. The program should then display the total monthly cost of these expenses, and the total annual cost of these expenses.
Module main()
Declare Integer number
Display " Enter loan”
Input loan
Declare Integer number
Display " Enter insurance”
Input insurance
Declare Integer number
Display " Enter gas”
Input gas
Declare Integer number
Display " Enter oil”
Input oil
Declare Integer number
Display " Enter tires”
Input tires
Declare Integer number
Display " Enter maintenance”
Input maintenance
Call totalCost(
2. For your second relationship, identify the independent and dependent variables and describe the attributes of each.
1. The pressure announced on last night's television weather broadcast was 29.92. Explain how this was measured and give the units. Would this be considered an unusually large or low pressure value?
How much of our global energy supply do nuclear power, biomass energy, and hydroelectric power contribute? How much of our global electricity do these three conventional energy alternatives generate?
The Age Discrimination in Employment Act (ADEA) passed in 1967. It was intended to protect the older half of the workforce from age discrimination in the workplace. Several of the major provisions of the ADEA include: protecting what a worker has earned in his/her tenure, allowing workers to oppose practices that are considered unlawful by the ADEA without consequence, and prevent employers and employment agencies from discriminating
The Family and Medical Leave Act sets regulations for job-protected leave related to family and medical reasons. FMLA applies to organizations with 50 or more employees working within 75 miles of the employee’s worksite (“Employment Laws,” n.d., para. 6). Employees who have been with their current employer for 12 months and who have worked 1250 hours of service in the previous 12 months are eligible for 12 weeks of unpaid leave through FMLA (“Eligibility Requirements,” Revised 2013). FMLA covers the following leave reasons:
2. Draw a flow diagram of the unit operations involved in sugar refining and at each step write a brief sentence explaining what is occurring. Use the information from SKIL site to develop your flow chart. Since the information does not start from the beginning of the refining process, please include an extraction step (extraction is explained in your textbook). Either milling or diffusion is
The teacher has to be responsible for designing the scheme of work, lesson plans, obtaining up to date qualification handbooks, agree individual learning plans, carrying out risk assessments, write realistic aims.
Offer- This is defined as a clear manifestation of willingness to enter an agreement made by another person with full understanding that their assent to the bargain is an invitation and is concluded.
(TCO 13) When a file is opened in output mode, the file pointer is positioned _____.
12. If there are values referenced continually in the application, storing them in packaged variables will allow the values to only be retrieved once thus saving data retrieval processing. The values in global constructs are persistent for the entire user session.
Classes: A class is specifically set of instructions that allow creating different objects, which define the
Let us consider of an example of syntax and semantics using while statement in C language
Smalltalk uses untyped variables and they must be declared before using. The reason why variables should be declared is that we can inform the compiler to leave some memory space for variables. Python also in the same case that it has untyped variables but those do not need to be explicitly declared. Whenever assignment happens for variables, the declaration also occurs. Since no type checks happen at compile time, the responsibility is of programmers to ensure that variables will receive the correct kind of values. The two languages provide type conversions that will return the new objects represent converted values.
Modules can be redesigned and programmed so that they can be used in other applications or systems.
2. The init () method is the module gets executed first. This makes a call to the display panel for calculator like structure/