Pascal/Turbo Pascal - Ayuda, hacer nota de venta en turbo pascual

 
Vista:

Ayuda, hacer nota de venta en turbo pascual

Publicado por jesus (3 intervenciones) el 20/06/2013 23:12:20
Nota de venta de una tienda que pida la información de 5 productos que situé el ratón en cada pregunta y que los sume y saque el total de esos productos
Por favor, de ante mano gracias!
PD: No importa si lo sepan hacer en c++ o en turbo pascal,
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

Ayuda, hacer nota de venta en turbo pascual

Publicado por ramon (2158 intervenciones) el 21/06/2013 21:55:30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
{A ver si esto ayuda}
 
 program opcionmous;
  uses
     crt;
 
   const
      product = 5;
 
   var
     productos : array[1..product] of real;
     suma : real;
     cont : integer;
     salir : boolean;
     raton : boolean;
     x, y : word;
 
  procedure asignaprecion;
  var
    i, canti : integer;
  begin
      randomize;
      canti := 0;
      for i := 1 to product do
      begin
         canti := random(230) + 1;
         productos[i] := canti;
         canti := 0;
      end;
  end;
 
  function raton_presente : boolean;
  var
     si : integer;
  begin
    asm
      mov ah,00h
      mov al,00h
      int 33h
      mov si,ax
    end;
      if si <> 0 then
      raton_presente := true
    else
      raton_presente := false;
  end;
 
  procedure muestra_raton;
  begin
      raton := false;
      if raton_presente then
      begin
         asm
          mov ah,00h
          mov al,01h
          int 33h
         end;
          raton := true;
      end;
  end;
 
  procedure oculta_raton;
  begin
      if raton = true then
      begin
       asm
         mov ah,00h
         mov al,02h
         int 33h
       end;
         raton := false;
       end;
  end;
 
  function posx_raton : word;
  var
    px : integer;
  begin
      posx_raton := 0;
    asm
      mov ah,00h
      mov al,03h
      int 33h
      mov px,cx
    end;
      posx_raton := word((px div 8) + 1);
  end;
 
  function posy_raton : word;
  var
     py : integer;
  begin
      posy_raton := 0;
     asm
      mov ah,00h
      mov al,03h
      int 33h
      mov py,dx
     end;
      posy_raton := word((py div 8) + 1);
  end;
 
  function boton_raton : word;
  var
    boton : integer;
  begin
      boton_raton := 0;
     asm
      mov ah,00h
      mov al,03h
      int 33h
      mov boton,bx
    end;
      boton_raton := boton;
  end;
 
  procedure presentaproductos;
  var
     t, p : integer;
  begin
    clrscr;
    suma := 0;
    salir := false;
    muestra_raton;
    gotoxy(10,2);write('>> Suma De Productos Boton Derecho Fin Seleccion <<');
    gotoxy(13,3);write('**** Posicione El Mouse Y boton Izquierdo ****');
    gotoxy(21,5);write('  Producto Num. [1]');
    gotoxy(21,6);write('  Producto Num. [2]');
    gotoxy(21,7);write('  Producto Num. [3]');
    gotoxy(21,8);write('  Producto Num. [4]');
    gotoxy(21,9);write('  Producto Num. [5]');
   gotoxy(21,10);write('  Finaliza Suma [Fin]');
    gotoxy(13,12);write('**** Sececione productos ****');
    x := posx_raton;
    y := posy_raton;
  repeat
      if (x <> posx_raton) or (y <> posy_raton) then
      begin
         x := posx_raton;
         y := posy_raton;
      end;
     if boton_raton = 1 then
     begin
   case x of
  38 : case y of
      5 : p := 1;
      6 : p := 2;
      7 : p := 3;
      8 : p := 4;
      9 : p := 5;
     10 : salir := true;
    end;
  39,40 : case y of
     10 : salir := true;
     end;
   end;
   delay(180);
   case p of
 1 : begin suma := suma + productos[1]; end;
 2 : begin suma := suma + productos[2]; end;
 3 : begin suma := suma + productos[3]; end;
 4 : begin suma := suma + productos[4]; end;
 5 : begin suma := suma + productos[5]; end;
   end;
   p := 0;
 end;
  until salir = true;
   oculta_raton;
   clrscr;
   writeln('**** Lasuma De Los Productos Selecionados Es ****');
   writeln(' Importe Total : ',suma:0:2);
   writeln;
   writeln('<<<< Pulse Una Tecla >>>>');
   readkey;
  end;
 
 
  begin
      asignaprecion;
      presentaproductos;
  end.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
1
Comentar