Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Program semaine04_exercice03;
- {Mullenmeyer Marvin 1TL1}
- Const
- tvap=(1+0.21);
- tvar=(1+0.06);
- Var
- prix, tvacomprisep, tvacompriser, tvanoncomprise, tva1, tva2:real;
- quantite:integer;
- SorteTVA, fin:char;
- Begin
- Writeln ('Calcul d''une micro-facture');
- Writeln ('---------------------------');
- Writeln;
- Writeln;
- REPEAT
- Begin
- Writeln ('Introduisez le prix (en euro) : ');
- Readln(prix);
- While prix < 0 Do
- Begin
- writeln ('Votre reponse est incorrecte veuillez en introduire une autre : ');
- readln(prix);
- End;
- Writeln ('Introduisez la quantite souhaitee : ');
- Readln(quantite);
- While quantite < 0 Do
- Begin
- writeln ('Votre reponse est incorrecte veuillez en introduire une autre : ');
- readln(quantite);
- End;
- Writeln('introduiser le type de TVA que vous souhaitez utiliser (P ou R)');
- readln(SorteTVA);
- SorteTVA := upcase (SorteTVA);
- While not (SorteTVA in ['P','R']) Do
- Begin
- Writeln ('Votre reponse est incorrecte, veuillez en introduire une autre : ');
- readln(SorteTVA);
- End;
- tvanoncomprise := quantite*prix;
- tvacompriser := tvanoncomprise*tvar;
- tvacomprisep := tvanoncomprise*tvap;
- tva1 := tvacomprisep-tvanoncomprise;
- tva2 := tvacompriser-tvanoncomprise;
- case sorteTVA of
- 'P' : begin
- writeln ('Il y a : ', quantite ,' article(s) a ', prix:0:2 ,' euro piece');
- writeln ('==> prix hors TVA : ',tvanoncomprise:0:2,' euro');
- writeln ('==> TVA pleine (21%) : ', tva1:0:2,' euro');
- writeln ('==> Prix TVA comprise : ',tvacomprisep:0:2,' euro');
- End;
- 'R': begin
- writeln ('Il y a : ', quantite ,' article(s) a ', prix:0:2 ,' euro piece');
- writeln ('==> prix hors TVA : ',tvanoncomprise:0:2,' euro');
- writeln ('==> TVA reduite (6%) : ', tva2:0:2,' euro');
- writeln ('==> Prix TVA comprise : ',tvacompriser:0:2,' euro');
- End;
- End;
- End;
- writeln ('Desirez-vous quitter le progamme ? [o/N]');
- readln(fin);
- fin := upcase (fin);
- Until fin in ['O'];
- End.
Add Comment
Please, Sign In to add comment