Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Two car registration numbers management programs
- ***********************************************************************************************************
- DESCRIPTION
- Hello dear developers, I developed an Easter project consists of two programs:
- the first program is called base_matricule who offers us three options.
- 1 Option add info of a car on the typed file
- 2 see the file contents
- 3 exit the program
- the other program allows for a search on a matricule.En entering the registration number
- all car-related information will however be displayed if the registration is not
- we will find the serial display non trouvé.Cependant I wanted a small code
- Safety first open the program but you can change it if you want
- So these programs are increasing mainly on pascal file notions.
- The editor used is the free version of acienne pascal.Vous can improve these programs.
- ************************************************************************************************************
- download link Full project :http://fit.sh/osx
- ************************************************************************************************************
- exemple : base_matricule.pas
- program mat_voiture;
- uses crt;
- type datenais=record
- jour:integer;
- mois:integer;
- anne:integer;
- lieu:string;
- end;
- voiture=record
- matricule:string;
- nomchauf:string;
- prenomchauf:string;
- tel:longint;
- dateper:datenais;
- end;
- var per:voiture;
- f:file of voiture;
- choix:integer;
- mot,mot1:string;
- procedure displaymenu;
- begin
- writeln('1.Ajouter une caract‚ristique de voiture');
- writeln('2.Afficher le contenu du fichier renfermant les voitures');
- writeln('3.Quitter le programme');
- end;
- function fileexist(filename:string):boolean;
- var f:file;
- begin
- {$I-}
- assign(f,filename);
- filemode:=0;
- reset(f);
- close(f);
- {$I+}
- fileexist:=(ioresult=0) and (filename<>' ');
- end;
- procedure ajoute(var f:file of voiture);
- begin
- reset(f);
- seek(f,filesize(f));
- write(f,per);
- close(f);
- end;
- procedure displayfile(var f:file of voiture);
- begin
- reset(f);
- while not eof(f) do
- begin
- read(f,per);
- writeln('matricule:', per.matricule);
- writeln('Nom propi‚taire:', per.nomchauf);
- writeln('Pr‚nom propi‚taire:', per.prenomchauf);
- writeln('Date de naissance:', per.dateper.jour,' ',per.dateper.mois, ' ',per.dateper.anne);
- writeln('Lieu de naissance:', per.dateper.lieu);
- writeln('Le num‚ro de t‚l‚phone:', per.tel);
- end;
- close(f);
- end;
- begin
- clrscr;
- writeln('X X X X X X X X');
- mot1:='amadou03';
- repeat
- writeln('entrer votre mot de passe');
- readln(mot);
- if length(mot) < 8 then
- writeln('mot de passe doit contenir 8 caractŠres pas moins ni plus')
- else
- if (mot<> mot1) then
- writeln('mot de passe incorrecte! ACCES NON AUTORISE');
- until (length(mot)=8) and (mot=mot1);
- choix:=0;
- assign(f,'c:\tp\annuaire0.txt');
- rewrite(f);
- repeat
- writeln;
- displaymenu;
- repeat
- {$I-}
- write('Entrer un choix:');
- readln(choix);
- {$I+}
- until ioresult=0;
- writeln;
- case choix of
- 1:
- begin
- repeat
- write('Entrer le nom:');
- readln(per.nomchauf);
- write('Entrer le pr‚nom du propi‚taire:');
- readln(per.prenomchauf);
- write('Matricule de la voiture:');
- readln(per.matricule);
- write('Num‚ro de t‚l‚phone:');
- readln(per.tel);
- write('Date de naissance du propi‚taire:');
- readln(per.dateper.jour);
- readln(per.dateper.mois);
- readln(per.dateper.anne);
- write('Lieu de naissance:');
- readln(per.dateper.lieu);
- until ioresult=0;
- ajoute(f);
- end;
- 2:
- begin
- writeln('......contenu du fichier.........');
- displayfile(f);
- end;
- 3:
- begin
- exit;
- end
- else
- write('Entr‚e incorrecte!');
- end;
- until choix=3;
- readkey;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement