CSCI 150, Spring 2003
Home | | Course Schedule | | Assignments | | Lecture NotesLaboratory 4
Due at the end of today's class
Problem (similar to text problem #2 on page 110).
Write a Pascal program, named find.pas, that has an array variable capable of holding
ten integers. The program should do the following:
You may use the program skeleton given below:
program storeAndFind; { your name and program description goes here. } type listType = array [1..10] of integer; var list : listType; count : integer; number : integer; found : boolean; begin {need some code here fill the array with ten integers} {need some code here to get the number to look for} found := false; {need some code here to search the list for number} if found then begin writeln ('The number ',number,' was found in the list.') end else begin writeln ('The number ',number,' was not in the list.'); end; end. {end of main program store and find}
A sample session for the problem might look like the following:
11 1 3 8 10 41 36 133 6576 4 |
7 |
What To Turn In.
A printed listing of the lab program. Be sure that your name is in the program prologue’s comment section of the program.
Reminder.
Be sure to save a copy of each program on your P:\ drive, and delete your working copies from your D:\ drive.