CS 241:
Control Structures
Homework 1 (Solution)
Assigned: Thu. 10/28/04
Due: Thu. 11/04/04
-
[20 points]
Problem #7 of Chap. #1 on pg. 16 of the textbook.
- [Answer] 3 reasons for studying Pascal
- Pascal's program structure is a reasonable approximation of English.
- Pascal supports and encourages the use of descriptive words for variables and data types.
- Pascal facilitates good problem-solving habits.
-
[20 points]
Problem #14 of Chap. #1 on pg. 16 of the textbook.
- [Answer] The sequence of used to solve a problem is a(n)
Algorithm
-
[20 points]
Problem #21 of Chap. #1 on pg. 16 of the textbook.
- [Answer]
- Source Code
- Object Code
-
[20 points]
Problem #1 of Chap. #2 Exercises 2.2 on pg. 39 of the textbook.
- [Answer]
A valid identifier must begin with a letter of the alphabet followed by
an optional number (i.e. 0 to n) letters or digits.
-
[20 points]
Problem #21 of Chap. #2 Exercises 2.2 on pg. 39 of the textbook.
- [Answer] The three main sections of a Pascal program are:
- The Program Heading
- The (Optional) Declaration Section
- The Executable Section
This page is maintained by Christopher A. Gantz (cgantz@regis.edu).