Scheme logice-programare referat






1.     Sa se realizeze schema logica pentru determinarea maximului unui sir X de n elemente si a pozitiei lui in cadrul sirului.

 


Parallelogram: CITESTE
V[I]

MAX=V[1]

 
                                                 NU                                                  DA                        

                                                                                                                                       


                  


     

                                                    DA                                            DA


MAX=V[i]

 
                      

Parallelogram: AFISEAZA
MAX, POZ
                   NU

                                                                                                     NU


2.     Sa se realizeze schema logica pentru calculul sumei a n numere reale(X1,X2,X3,………..,XN) citite de la tastatura.


Parallelogram: CITESTE 
X[I]
                                                                                                             

                                       NU                                                        DA

                                                                                                                       


3.    Sa se realizeze schema logica pentru calculul produsului a n numere reale(X1,X2,X3,………..,XN) citite de la tastatura.


Parallelogram: CITESTE 
X[I]
                                                                                                             

                                 NU                                                                DA

                                                                                                                       


4.Sa se realizeze schema logica pentru calculul valorii functiei f(x)=xn, cu x si n dati de la tastatura.

Rounded Rectangle: START


                                                                                                            

P=P*X

 
                                         DA                                                    NU

                                                                                                                       


5.    Sa se realizeze schema logica pentru calculul expresiei:

E=

Rounded Rectangle: START


Parallelogram: CITESTE X

                                                                                                            

                                         DA                                                    NU

                                                                                                                       


6. Sa se realizeze schema logica pentru rezolvarea urmatoarei probleme x este suma ce o are de incasat o persoana pentru munca prestata si y suma care trebuie sa-I fie retinuta. Evidentiati toate situatiile ce se pot ivi atunci cand trebuie determinata suma ramasa de plata. Afisati rezultatul.


S=X-Y

 
                                                NU                                                 DA


              NU                           DA                                          

S=0

 
                                

                                                                                                                        


7. Fiind date trei valori reale A,B,C sa se determine si sa se afiseze cea mai mare dintre ele. Aceeasi problema pentru cea mai mica valoare.


                                     NU                                                 DA        

                                  

Diamond: A>C                                                                                          NU                                 DA


Diamond: A<C  NU                               DA




           

MAX=C

 
Diamond: B>C                                                                                                                                       NU                  DA

MIN=C

 
                                                                                                                                        


                  

Diamond: B>C


                                NU                                 DA   


     


8. Sa se realizeze schema logica pentru calculul sumei elementelor unui vector de 5 elemente.

Generalizarea pentru n elemente

Rounded Rectangle: START


                                        DA                                       NU      

                                     


                                                                                                            

I=I+1

 
                                                                                                                                 

Rounded Rectangle: STOP


-        Pe caz general


                                        DA                                       NU      

                                     


                                                                                                             

I=I+1

 
                                                                                                                                 

Rounded Rectangle: STOP


9. Sa se realizeze schema logica pentru evaluarea expresiei:

E=


                                                               

Parallelogram: CITESTE
A,B


                                                                      


                                             DA                                                                 NU


 

 

Parallelogram: AFISEAZA
E


                                                                                                            

                                                                                                                                 


10. Sa se realizeze schema logica pentru evaluarea expresiei:

E=


                                     DA                                                 NU       

                                 


Diamond: C=0                                                                                          NU                                 DA


Parallelogram: AFISEAZA
E

                                                                                                                        NU                                      

          

                                                                                                                                                        

Parallelogram: Afiseaza
“Expesia nu are sens”

E=

 
                                                                                                                                       


                  

Diamond: A=0


                                       NU                                     DA


     


11.     Fie a,b,c variabile ale caror valori sunt numere reale distincte, iar x o variabila booleana(0 sau 1). Sa se determine valoarea variabilei v

V=


                                                                

Parallelogram: CITESTE
A,B,C


                                                                      


                                                NU                                                 DA


                                                                                                         NU                                     DA

 





 

Parallelogram: AFISEAZA
“Expesia nu are valoare”

V=(A+B)/C

 


                                                                                                             

                                                                                                                                 


12. Sa se realizeze schema logica pentru determinarea mediei de varsta a unei colectivitati, cunoscand varsta fiecarui individ, pentru cazul in care se stie N numarul de membri.


Parallelogram: CITESTE 
v
                                                                                                             

                                       NU                                                        DA

                                                                                                                        


- pentru cazul in care nu se stie cati membri sunt


                                                                                                            


                                                                                                                        

N=N+1

 


                                      NU                                          DA


13.  Sa se realizeze schema logica pentru calculul numarului de elemente negative, pozitive si nule ale unui vector de n elemente.


Parallelogram: CITESTE V[I]

                            NU                                                    DA


                              

                                  

Parallelogram: AFISEAZA
POZ,NEG,NULE
Diamond: V[I]>0


                                                                                                  NU                             DA        


POZ=POZ+1

 
                                                                       NU                                 DA

Rounded Rectangle: STOP


           

NEG=NEG+1

 
                                                                                                                                      

NULE=NULE+1

 
                                                                                                                                       


                  


     

program p1;

  type vect=array[1..100] of integer;

  var i,n,poz,max:integer;

        v:vect;

  begin

    write('n=');

    readln(n);

  for i:=1 to n do

    readln(v[i]);

    max:=v[1];

    poz:=1;

    i:=2;

  for i:=1 to n  do

     if max<v[i] then begin

       max:=v[i];

       poz:=i;

                               end;

write(max,poz);

end.

program p2;

  type vect=array[1..100] of real;

  var i,n:integer;

        s:real;

        x:vect;

begin

  s:=0;

  write('n=');

  readln(n);

 for i:=1 to n do begin

    readln(x[i]);

    s:=s+x[i];

                          end;

write(s);

end.

program p3;

  type vect=array[1..100] of real;

  var i,n:integer;

        p:real;

        x:vect;

begin

  p:=1;

  write('n=');

  readln(n);

 for i:=1 to n do begin

    readln(x[i]);

    p:=p*x[i];

                          end;

write(p);

end.

program p4;

  var x,n,i,p:integer;

begin

  write('n=');

  readln(n);

  write('x=');

  readln(x);

  p:=1;

 for i:=1 to n do

    p:=p*x;

write(p);

end.

program p5;

  var x,s,n,e,i,p:integer;

begin

  write('n=');

  readln(n);

  s:=0;

  p:=1;

 for i:=1 to n do begin

    readln(x);

    s:=s+x;

    p:=p*x;

                        end;

     e:=s+p;

write(e);

end.

program p6;

  var x,y,s:integer;

begin

  write('x=');

  readln(x);

  write('y=');

  readln(y);

 if x>y then s:=x-y

           else

               if x=y then s:=0

                         else s:=y-x;

write(s);

end.



program p7;

  var a,b,c,min,max:real;

begin

  write('a=');

  readln(a);

  write('b=');

  readln(b);

  write('c=');

  readln(c);

     if a>b then begin

            if a>c then begin

                    max:=a;

                        if b>c then min:=c

                                  else min:=b;

                              end

                       else begin

                            min:=b;

                             max:=c;

                           end;end

         else if a<c then begin

                    min:=a;

                          if b>c then max:=b

                                    else max:=c

                                    end

                            else begin

                               min:=c;

                               max:=b;

                           end;

                   write(min,max);

                   end.

program p8;

  type vect=array[1..100] of integer;

  var i,s:integer;

        v:vect;

begin

  s:=0;

 for i:=1 to 5 do begin

    readln(v[i]);

    s:=s+v[i];

                          end;

write(s);

end.

program p8_gen;

  type vect=array[1..100] of integer;

  var i,s,n:integer;

        v:vect;

begin

  write('n=');

  readln(n);

  s:=0;

 for i:=1 to n do begin

    readln(v[i]);

    s:=s+v[i];

                           end;

write(s);

end.

program p9;

  var a,b,e:real;

begin

  write('a=');

  readln(a);

  write('b=');

  readln(b);

 if (a-(b*b))=0 then

   write('Expresia nu are valoare')

               else

                    e:=((a*a)+b)/(a-(b*b));

write(e);

end.

program p10;

  var a,b,c,e:real;

begin

  write('a=');

  readln(a);

  write('b=');

  readln(b);

  write('c=');

  readln(c);

   if c>0 then if c=0 then

                 if (a*a)-b=0 then

                     begin

                   e:=sqrt((a*a)-b);

                   write(e);

                     end

                                     else

                        write('Expresia nu are sens')

                       else if a=0 then

                           write('Expresia nu are sens')

                                    else begin

                            e:=1/(a*a)-b;

                            write(e);

                                            end

           else begin

             e:=(a*a)-b;

             write(e);

                 end;

end.

program p11;

  var a,b,c,v:real;x:boolean;

begin

  write('a=');

  readln(a);

  write('b=');

  readln(b);

  write('c=');

  readln(c);

   while x do v:=a+b+c;

   if c=0 then  write('Expresia nu are sens')

          else  v:=(a+b)/c;

write(v);

end.

program p12;

  var s,n,i,m,v:integer;

begin

  write('n=');

  readln(n);

  s:=0;

 for i:=1 to n do begin

          readln(v);

          s:=s+v;

                          end;

        m:=s div n;

        write(m);

end.

program p12_gen;

  var s,n,i,m,v:integer;

begin

  s:=0;

  n:=0;

  i:=0;

 repeat

  write('v=');

  readln(v);

  s:=s+v;

  n:=n+1;

  write('mai sunt membri?(Y/N)');

  read(i);

 until i<>0;

          m:=s div n;

          write(m);

end.

program p13;

  type vect=array[1..100] of integer;

  var i,n,poz,neg,nule:integer;

        v:vect;

begin

  write('n=');

  readln(n);

  for i:=1 to n do begin

  readln(v[i]);

  if v[i]>0 then

     poz:=poz+1

              else

              if v[i]=0 then

               nule:=nule+1

                         else

               neg:=neg+1;end;

  write(poz,neg,nule);

end.

1.      2 buni prieteni matematicieni care nu s-au vazut demult discuta in pauza unui congres:

-        cati ani au copii tai?

-        Hai sa-ti raspund cu o ghicitoare: am 3 copii,inmulteste numarul anilor pe care I-au trait pana acum si obtii 36

-        Nu-mi ajunge

-        Acum aduna acele numere si vei obtine suma ferestrelor casei de vis – a – vis

-        Mai da-mi o informatie

-        Ai dreptate, trebuia sa-ti spun ca celui mai tanar nu-I place ciocolata neagra.

Rezolvare:

         Cele 3 numere care inmultite dau produsul 36 sunt:

1*6*6=36

1*4*9=36

2*2*9=36

2*3*6=36

3*3*4=36

1*1*36=36

        

         Adunate , se obtin urmatoarele sume:

       1+6+6=13

       1+4+9=14

       2+2+9=13

       2+3+6=11

       3+3+4=10

  1+1+36=38

         Se observa ca se obtin 2 raspunsuri identice, drept pentru care solutia va fi 1, 6, 6  - celui mic(1) nu-I place ciocolata neagra.

2.     Pentru impodobirea pomului de Craciun cu pachete cadou, o gradinita de copii are 320 de banane, 240 de bomboane si 200 de mandarine. Care este numarul de pachete identice ce se pot face din aceste daruri si cate banane, bomboane si mandarine va avea fievare pachet?

Rezolvare: Problema se rezolva folosind procedeul de calcul pentru cel mai mic multiplu comun(cmmdc). Astfel

320=26*5

240=24*3*5

200=23*52

deci cmmdc=23*5=40(nunarul de pachete)

Numarul de banane, bomboane si mandarine se obtine prin impartirea numarului total de banane, bomboane, mandarine la numarul de pachete.

Astfel se obtin 8 banane, 6 bomboane si 5 mandarine in fiecare pachet.









Copyright © Contact | Trimite referat


Ultimele referate adaugate
Mihai Beniuc
   - Mihai beniuc - „poezii"
Mihai Eminescu Mihai Eminescu
   - Mihai eminescu - student la berlin
Mircea Eliade Mircea Eliade
   - Mircea Eliade - Mioara Nazdravana (mioriţa)
Vasile Alecsandri Vasile Alecsandri
   - Chirita in provintie de Vasile Alecsandri -expunerea subiectului
Emil Girlenu Emil Girlenu
   - Dragoste de viata de Jack London
Ion Luca Caragiale Ion Luca Caragiale
   - Triumful talentului… (reproducere) de Ion Luca Caragiale
Mircea Eliade Mircea Eliade
   - Fantasticul in proza lui Mircea Eliade - La tiganci
Mihai Eminescu Mihai Eminescu
   - „Personalitate creatoare” si „figura a spiritului creator” eminescian
George Calinescu George Calinescu
   - Enigma Otiliei de George Calinescu - geneza, subiectul si tema romanului
Liviu Rebreanu Liviu Rebreanu
   - Arta literara in romanul Ion, - Liviu Rebreanu

















Cauta referat
Scriitori romani