Unit 2 Homework
Pg. 71 Short Answer
1) What does a professional programmer usually do first to gain an understanding of a
problem? Interview the customer
2) What is pseudocode? Fake code used as a model for programs
3) Computer progra
Unit 10 Homework
1. Describe the three steps that must be taken when a file is used by a program.
open file, process file, close file
2. Why should a program close a file when its finished using it?
Closing a file disconnects t
Unit 9 Homework
1. What is the difference between a module and a function?
A module is a group of statements that exist within a program for the purpose of
performing a specific task. A function is a module that returns a value
Unit 7 Homework
1. Why should you indent the statements in the body of a loop?
The indentation of the text indicates how it is nested and is required for a loop to
2. Describe the differences between pretest l
Unit 8 Homework
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 =
Unit 6 Homework
6) Rewrite the following IF-Then-Else If statement as a Select Case
case is 1
Display "You selected A.'
case is 2
Display "You selected 2."
case is 3
Display "You selected 3."
case is 4
Unit 5 Homework
1) Explain what is meant by the term conditionally executed.
A condition that is performed only when is true
2) You need to test a condition and then execute one set of statements if the
is true. If the condition
Unit 4 homework
1) How do modules help you reuse code in a program?
Because you are writing code to perform a specific task
2) Name and describe the two parts that a module definition has in most
A header and a body
Unit 1 Homework
1) The CPU is required to run programs.
2) A bit that is turned on is represented by 1, and a bit that is turned off is represented
by a 0.
3) A device that works with binary data is referred to as a digit
Unit 3 Homework
5) What two things must you normally specify in a variable declaration?
Specify the variable type and an identifier.
int n; / type - int, identifier - n
6) What value is stored in uninitialized variables?
It is a