Page 328 - Introduccion a la Programacion
P. 328

328     Introducción a la Programación





                           PRUEBA DE ESCRITORIO


                                                               VENTAS
                           cantidad          ventas          entre          menores           mayores
                                               0
                                               0
                               0              <<.               0               0                 0
                                               0
                                               0
                                              100
                                              200
                               4                                0               2                 2
                                              3000
                                              4000




                           ALGORITMO EN PseInt
                           PRUEBA DE ESCRITORIO EN PseInt



                            1.  /* Realice un algoritmo con arreglos unidimensionales para las
                                 ventas
                            2.   * de todo un mes. La tienda desea conocer aquellas ventas de
                                 mayores
                            3.   * a $ 1000 y aquellas que son entre $800 y $1000 y las que son
                            4.     inferiores a $800. //
                            5.  Algoritmo VENTAS
                            6.      DEFINIR cantidad, mayores, entre, menores Como ENTERO;
                            7.      ESCRIBIR “Ingrese la cantidad de ventas del mes:”;
                            8.      LEER cantidad;
                            9.      DIMENSION ventas[cantidad];
                            10.      PARA i <- 1 HASTA cantidad CON PASO 1 HACER
                            11.      .  ESCRIBIR “Ingrese el monto de la venta:”;
                            12.      .  LEER ventas[i];
                            13.      .  SI (ventas[i] <= 1000) ENTONCES
                            14.      .  .  SI (ventas[i] <= 800) ENTONCES
                            15.      .  .  .  entre <- entre + 1;
                            16.      .  .  SINO
                            17.      .  .  .  menores <- menores + 1;
                            18.      .  .  FINSI
                            19.      .  SINO
                            20.      .  .   mayores <- mayores + 1;
   323   324   325   326   327   328   329   330   331   332   333