Sie sind auf Seite 1von 13

Universidad Nacional Autónoma De

Honduras
EJEMPLO DE ALGORITMO PSEUDOCODIGO
Y FLUJOGRAMA

Calcular el Total A Pagar de un Producto X


Proceso de Análisis e Interpretación del problema:

Entrada: Leer el nombre del cliente, Leer el código, nombre o


descripción del producto, precio y cantidad de un
producto
Proceso: Calcular el total a pagar de un producto con descuento
de la tercera edad (30%) y ISV.

- Cálculo del Subtotal


- Cálculo de descuento
- Cálculo del impuesto
- Cálculo del Total a pagar
Salida: Mostrar resultados del total a pagar
Datos
Auxiliares: Subtotal, ISV, descuento, total a pagar

Los datos auxiliares son variables que se definen para contar,


acumular cantidades, banderas, o algunos datos intermedios que se
necesitan para llegar a obtener las salidas
Algoritmo:
1.- Inicio
2.- Declaración De Variable
3.- Inicializar Variable
4.- Leer Datos
4.1- Nombre de Cliente
4.2 RTN (OPCIONAL)
4.3 Leer El Código
4.4 Leer El Nombre Del Producto
4.5 Leer El Precio Del Producto
4.6 Leer La Cantidad A Llevar
4.7 Edad
5.- Calcular
5.1 Calcular El Subtotal
5.2 Calculo del Descuento
5.3 Calcular El ISV
5.4 Calcular El Total
6.- Mostrar Resultados
6.1 Código
6.2 Nombre
6.3 Precio
6.4 Cantidad
6.5 Total
7.- Fin

Pseudocódigo:
Proceso Producto
//Nombre:
//Cuenta:
//Fecha: 26 De MAyo Del 2015
//Objetivo: determinar el total a pagar de un producto
// Modificado 25/04/2017 Por: Rosmery Corrales
// Que Modifique: Calculo descuento

//Definición De Variables
Definir codigo como entero;
Definir nombre, descripcion_producto como caracter;
Definir precio, des, isv, subtotal, total como real;
Definir cantidad, edad como entero;

//Inicialización De Variable
código<-0;
nombre<-" ";
precio<-0;
cantidad<-0;
des<-0;
edad<-0;
subtotal<-0;
isv<-0;
total<-0;
//Lectura De Datos

Escribir "Introduzca Nombre de Cliente";


Leer nombre;
Escribir "Introduzca la edad del Cliente";
Leer edad;

Escribir "Introduzca El Código Del Producto";


Leer codigo;
Escribir "Introduzca El Nombre Del Producto";
Leer descripcion_producto;

Escribir "Introduzca El Precio Del Producto";


Leer precio;
Escribir "Introduzca La Cantidad A Llevar Del Producto";
Leer cantidad;
//Calcula El Subtotal Sin El Impuesto
subtotal<-precio*cantidad;
//Calcula El Descuento
Si edad>=65
Entonces
des<-(subtotal *0.30);
FinSi

//Calcula El ISV
isv<-(((precio*cantidad)-des)*0.15);
//Calcula El Total A Pagar
total<-subtotal-des+isv;
//Mostrar Resultados

Escribir "Nombre Cliente: " Sin Saltar;


Escribir nombre;

Escribir "Edad: " Sin Saltar;


Escribir edad;

Escribir "Código: " Sin Saltar;


Escribir codigo;
Escribir "Nombre del producto: " Sin Saltar;
Escribir descripcion_producto;

Escribir "Precio: " Sin Saltar;

Escribir precio;
Escribir "Cantidad: " Sin Saltar;
Escribir cantidad;
Escribir "Subtotal: " Sin Saltar;
Escribir Subtotal;
Escribir "Descuento: " Sin Saltar;
Escribir des;
Escribir "Impuesto Sobre Venta: " Sin Saltar;
Escribir isv;
Escribir "Total: " Sin Saltar;
Escribir total;
FinProceso

Flujograma:
Inicio

Inicializar
Variables

Nombre<-0

Edad<-0
Código<-0

Descripción<-“ “

Precio<-0

Cantidad<-0

Subtotal<-0

ISV<-0

Total<-0

1
1
Introduzca el Código del Producto

Código

Introduzca el Nombre
Nombre

Introduzca el Precio del Producto

Precio

Introduzca La Cantidad Del Producto

Cantidad

Subtotal<-(Precio*Cantidad)

22

Edad
>65
Des<-(Subtotal*0.30)

ISV<-((Subtotal-des)*0.15)
Total<-(Subtotal-des+ISV)

ISV<-((Precio*Cantidad)*0.12)

Total<-(Subtotal+ISV)

Nombre
Edad

Codigo,
Descripcion
producto

Precio

4
4

Cantidad

Total
Fin

Das könnte Ihnen auch gefallen