CSCI 150, Spring 2003
Home | | Course Schedule | | Assignments | | Lecture NotesLaboratory 4
Problem (similar to text problem #2 on page 110).
You may use the program skeleton given below:
A sample session for the problem might look like the following:
What To Turn In. A printed listing of the lab program.
Be sure that your name is in the program prologues comment section of the program.
Reminder. Be sure to save a copy of
each program on your
Due at the end of today's class
Write a Pascal program, named find.pas, that has an array variable capable of holding
ten integers. The program should do the following:
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}
Please enter ten integers separated by a space....
Please enter a number to search for:
11 1 3 8 10 41 36 133 6576 4
The number 7 was not in the list.
7