Comp Prog WEgr Application
Comp Prog WEgr Application CS 2073
Popular in Course
Popular in ComputerScienence
verified elite notetaker
This 1 page Class Notes was uploaded by Mireya Heidenreich on Thursday October 29, 2015. The Class Notes belongs to CS 2073 at University of Texas at San Antonio taught by Staff in Fall. Since its upload, it has received 14 views. For similar materials see /class/231392/cs-2073-university-of-texas-at-san-antonio in ComputerScienence at University of Texas at San Antonio.
Reviews for Comp Prog WEgr Application
Report this Material
What is Karma?
Karma is the currency of StudySoup.
Date Created: 10/29/15
CS 2073 Example of Sequential Search Mon Mar 26 2001 035504 CST program insertion Name Neal R Wagner Date March 26 1992 Course CS 2073 Section 001 Program Insert license numbers into an arra Assumes license numbers are just integers lnput A file of old license numbers LlC DAT internally Lfile Output The same file updat d M const MAXL 10 max number of license numbers type Ltype arraylMAXL of integer the main array var L Lt e the main array numL integer current number of license numbers M Lfile text the file of license numbers X integer new license number to lookup M function lookup L Ltype X integer numL integer integer loo up license number X in array L ar 1 integer begin lookup 0 for i l to numL do if Li X then lookup i end lookup procedure insertvar L Ltype X integer var numL integer insert new licens er X in array L M ASSUMES X NOT ALREADY PRESENT M begin if numL MAXL then writeln overflow else begin numL numL l LnumL X d end insert M procedure loadLvar Lfile text var L Ltype var numL integer read from file LlC DAT into L M begin resetLfile LlC DAT numL 0 while not eofLfile and numL lt MAXL do begin numL numL l readlnLfile LnumL end end loadL M procedure dumpLvar Lfile ext L Ltype numL integer write array L into file LlC DAT M var i integer begin rewriteLfile LlC DAT writeln dummping L i to numL do begin writelnLfile Li writelnLi end closeLfile end dumpL M be in loadLLfile L writeln Please enter new license readlnX while X ltgt 0 do begin if lookupL X numL numL gt 0 then writeln Tow the car with license X Page 1