Guest User

Untitled

a guest
Jan 17th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.58 KB | None | 0 0
  1. Program semaine04_exercice03;
  2.  
  3. {Mullenmeyer Marvin 1TL1}
  4.  
  5.  
  6. Const
  7.  
  8. tvap=(1+0.21);
  9. tvar=(1+0.06);
  10.  
  11.  
  12. Var
  13. prix, tvacomprisep, tvacompriser, tvanoncomprise, tva1, tva2:real;
  14. quantite:integer;
  15. SorteTVA, fin:char;
  16.  
  17.  
  18.  
  19. Begin
  20.  
  21.  
  22. Writeln ('Calcul d''une micro-facture');
  23. Writeln ('---------------------------');
  24.  
  25.  
  26. Writeln;
  27. Writeln;
  28.  
  29.  
  30. REPEAT
  31. Begin
  32. Writeln ('Introduisez le prix (en euro) : ');
  33. Readln(prix);
  34. While prix < 0 Do
  35. Begin
  36. writeln ('Votre reponse est incorrecte veuillez en introduire une autre : ');
  37. readln(prix);
  38. End;
  39.  
  40. Writeln ('Introduisez la quantite souhaitee : ');
  41. Readln(quantite);
  42. While quantite < 0 Do
  43. Begin
  44. writeln ('Votre reponse est incorrecte veuillez en introduire une autre : ');
  45. readln(quantite);
  46. End;
  47.  
  48.  
  49. Writeln('introduiser le type de TVA que vous souhaitez utiliser (P ou R)');
  50. readln(SorteTVA);
  51. SorteTVA := upcase (SorteTVA);
  52. While not (SorteTVA in ['P','R']) Do
  53. Begin
  54. Writeln ('Votre reponse est incorrecte, veuillez en introduire une autre : ');
  55. readln(SorteTVA);
  56. End;
  57.  
  58.  
  59. tvanoncomprise := quantite*prix;
  60. tvacompriser := tvanoncomprise*tvar;
  61. tvacomprisep := tvanoncomprise*tvap;
  62. tva1 := tvacomprisep-tvanoncomprise;
  63. tva2 := tvacompriser-tvanoncomprise;
  64.  
  65. case sorteTVA of
  66. 'P' : begin
  67. writeln ('Il y a : ', quantite ,' article(s) a ', prix:0:2 ,' euro piece');
  68. writeln ('==> prix hors TVA : ',tvanoncomprise:0:2,' euro');
  69. writeln ('==> TVA pleine (21%) : ', tva1:0:2,' euro');
  70. writeln ('==> Prix TVA comprise : ',tvacomprisep:0:2,' euro');
  71. End;
  72.  
  73. 'R': begin
  74. writeln ('Il y a : ', quantite ,' article(s) a ', prix:0:2 ,' euro piece');
  75. writeln ('==> prix hors TVA : ',tvanoncomprise:0:2,' euro');
  76. writeln ('==> TVA reduite (6%) : ', tva2:0:2,' euro');
  77. writeln ('==> Prix TVA comprise : ',tvacompriser:0:2,' euro');
  78. End;
  79. End;
  80. End;
  81. writeln ('Desirez-vous quitter le progamme ? [o/N]');
  82. readln(fin);
  83. fin := upcase (fin);
  84. Until fin in ['O'];
  85.  
  86. End.
Add Comment
Please, Sign In to add comment