SHORT ANSWERS, Page 409
1. Describe the three steps that must be taken when a file is used by a program
Open the file, Process the file, Close the file
2. Why should a program close a file when its finished using it
By closing a
What similarities do you see between the two programs?
What differences do you see between the two programs?
What input devices are used in the GUI and console programs?
What output devices are used in the GUI and
SHORT ANSWER, Page 253
1. What is the difference between a module and a function?
Function and Procedure is a method, and are much the same. Function must return a value, back
to the part of the program that called it, but proced
6. What is an infinite loop? Write the code for an infinite loop.
An infinite loop continues to repeat itself until the program is interrupted.
The code for an infinite loop, looks as follows: While keepgoing = y
1. How do modules help you to reuse code in a program?
Modules also reduce the duplication of code within a program, and this benefit of
using modules is known as code reuse because you are writing the code to perfor
Lab 4.1: Pseudocode and Module
Module main ()
/Declare local variables
1. Declare String clientName
2. Declare Real feetUTP
3. Declare Real subTotal
4. Declare Real taxCost
5. Declare Real totalCost
6. Call inputData ()
Lab 3.1 Pseudocode
Declare Real creditsTaken
Declare Integer creditsLeft
Declare Real studentName
Constant Real Credits Needed =
Problem (Yes or NO)
If Yes, whats wrong?
This should be a String