0% found this document useful (0 votes)
11 views4 pages

Abdooooo

Pharmacie lesson

Uploaded by

olatunjiayhoub
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views4 pages

Abdooooo

Pharmacie lesson

Uploaded by

olatunjiayhoub
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

program Untitled;

uses wincrt;

const t=5;

type module=^tmodule;

tmodule=record

nom:string;

coef:integer;

note :real;

suiv:module;

end;

etudiant=^tetudiant;

tetudiant=record

nomet:string;

modu:module;

suiv:etudiant;

end;

var tete:^tetudiant ;

pred,tmp,q:^tetudiant;

tetem :^tmodule ;

predm,tmpm,qm:^tmodule;

i,n,s:integer;

snote,scoef,moyenne:real;

begin

new(tete);

writeln('donnes nom et') ;


readln(tete^.nomet);

tete^.suiv:= nil;

pred:=tete;

for i:=2 to t do

begin

new(tmp);

writeln('donnes nom et') ;

readln(tmp^.nomet);

if i=3 then

begin

writeln('donnes nbre module') ;

readln(n);

new(tetem);

writeln('donnes nom module') ;

readln(tetem^.nom);

writeln('donnes note module') ;

readln(tetem^.note);

writeln('donnes coef module') ;

readln(tetem^.coef);

snote:=tetem^.note*tetem^.coef +snote;

scoef:=scoef+ tetem^.coef;

tetem^.suiv:= nil;

predm:=tetem;

s:=0;

for s:=2 to n do

begin
new(tmpm);

writeln('donnes nom module') ;

readln(tmpm^.nom);

writeln('donnes note module') ;

readln(tmpm^.note);

writeln('donnes coef module') ;

readln(tmpm^.coef);

snote:=tmpm^.note*tmpm^.coef +snote;

scoef:=scoef+ tmpm^.coef;

tmpm^.suiv:=nil;

predm^.suiv:=tmpm;

predm:=tmpm;

end;

end;

tmp^.suiv:=nil;

pred^.suiv:=tmp;

pred:=tmp;

end;

moyenne:=snote/scoef;

tmp:=tete;

i:=1;

while (tmp<>nil) do

begin
i:=i+1;

writeln('Nom: ',tmp^.nomet);

writeln('+++++++++++');

if i=3 then

begin

tmpm:=tetem;

while (tmpm<>nil) do

begin

writeln('Nom: ',tmpm^.nom);

writeln('note: ',tmpm^.note);

writeln('coef: ',tmpm^.coef);

writeln('moyenne :',moyenne);

writeln('+++++++++++'); writeln ;

tmpm:=tmpm^.suiv;

end;

end;

tmp:=tmp^.suiv;

end;

readkey;

end.

You might also like