Advertisement
Guest User

Untitled

a guest
Feb 17th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4.  
  5. int main(){
  6.  
  7. int vent,tarj;
  8. char codigo;
  9. float total,contador,result,iva;
  10.  
  11. vent=tarj=contador=0;
  12.  
  13. printf("Ingresa el codigo: ");
  14. fflush(stdin);
  15. scanf("%c",&codigo);
  16.  
  17. if (codigo == 'F')
  18. {}
  19. else
  20. {
  21. printf("Ingresa el importe total: ");
  22. fflush(stdin);
  23. scanf("%f",&total);
  24. }
  25.  
  26. system("clear");
  27.  
  28. while(codigo!='F')
  29. {
  30.  
  31. if(codigo=='C')
  32. {
  33. result=(70*total)/100;
  34. vent++;
  35. contador+=result;
  36. system("clear");
  37. }
  38. else
  39. {
  40. if(codigo=='E')
  41. {
  42. result=(90*total)/100;
  43. vent++;
  44. contador+=result;
  45. system("clear");
  46. }
  47. else
  48. {
  49. if(codigo=='T')
  50. {
  51. result=((total*12)/100)+total;
  52. vent++;
  53. tarj++;
  54. contador+=result;
  55. system("clear");
  56. }
  57. }
  58. }
  59.  
  60. printf("Ingresa el codigo: ");
  61. fflush(stdin);
  62. scanf("%c",&codigo);
  63.  
  64. if (codigo == 'F')
  65. {}
  66. else
  67. {
  68. printf("Ingresa el importe total: ");
  69. fflush(stdin);
  70. scanf("%f",&total);
  71. }
  72.  
  73. system("clear");
  74.  
  75. }
  76.  
  77. iva=(21*contador)/100;
  78.  
  79. printf("----------------------------\n");
  80. printf("\n Efectivo en caja: %.2f\n Ventas con tarjeta: %d\n Total de ventas: %d\n Importe del IVA: %.2f\n",contador,tarj,vent,iva);
  81. printf("\n----------------------------");
  82.  
  83. return 0;
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement