Ejercicio 6 lpp

Ejercicio 5 lpp:

Crear Factura

Solución al ejercicio:

 //definición variables
Cadena[30] nombre_cliente
Caracter nombre_producto
Entero cantidad_producto,total_a, n, aa,total_b, ca, cb, na, nb, nbu, ng, nr, cbu, cg, cr, total_bu, total_g, total_r,total


Inicio //programa principal
total_bu<-0
 total_g<-0
 total_r<-0
 total_a<-0
 total_b<-0

Escriba "Ingrese el nombre del cliente: "
Lea nombre_cliente
Escriba "Ingrese la cantidad de productos diferentes: "
Lea n
Escriba "El nombre del producto se basa en: " 
llamar Nueva_linea
Escriba "U para Budweiser, G para Grolsch,"
llamar Nueva_linea
Escriba "R para Redds,A para aguila, B para BBC "
llamar Nueva_linea
para aa<-0 hasta n-1 haga
Escriba "Ingrese el nombre del producto: "
Lea nombre_producto
Escriba "Ingrese la cantidad del producto: "
Lea cantidad_producto

si nombre_producto= 'U' Entonces
nbu<-1
cbu<- cantidad_producto
total_bu<-500*cbu
Fin si

si nombre_producto= 'G' Entonces
ng<-2
cg<- cantidad_producto
total_g<-10*cg
Fin si

si nombre_producto= 'R' Entonces
nr<-3
cr<- cantidad_producto
total_r<-1200*cr
Fin si

si nombre_producto= 'A' Entonces
na<-4
ca<- cantidad_producto
total_a<-1500*ca
Fin si
si nombre_producto= 'B' Entonces
nb<-5
cb<- cantidad_producto
total_b<-2500*cb
Fin si

Fin para

llamar Nueva_linea
Escriba "Nombre del cliente: ",nombre_cliente
llamar Nueva_linea
llamar Nueva_linea

si nbu = 1 Entonces
Escriba "Producto: Budweiser  "
Escriba "Cantidad producto: ",cbu
Escriba "   Total producto: ",total_bu
llamar Nueva_linea
Fin si 

si ng = 2 Entonces
Escriba "Producto: Grolsch    "
Escriba "Cantidad producto: ",cg
Escriba "   Total producto: ",total_g
llamar Nueva_linea
Fin si 

si nr = 3 Entonces
Escriba "Producto: Redds      "
Escriba "Cantidad producto: ",cr
Escriba "   Total producto: ",total_r
llamar Nueva_linea
Fin si 

si na = 4 Entonces
Escriba "Producto: Aguila     "
Escriba "Cantidad producto: ",ca
Escriba "   Total producto: ",total_a
llamar Nueva_linea
Fin si 

si nb = 5 Entonces
Escriba "Producto: BBC        "
Escriba "Cantidad producto: ",cb
Escriba "   Total producto: ",total_b
Fin si 

total<- total_bu+ total_g+ total_r+total_a+total_b
Escriba "                               Valor total:    ",total

Fin

En la siguiente imagen se muestra la solución al ejercicio:



Comentarios

  1. The Ultimate Guide to TiG Poker in a TiG Poker Tournament
    Poker oakley titanium glasses is an all-in-one and all-in-one casino game played titanium crystal in a Each race tech titanium poker tournament has a titanium price per pound different layout. All poker titanium white dominus price tournament starts with a

    ResponderBorrar

Publicar un comentario

Entradas más populares de este blog

Ejercicio 1 Java

Ejercicio 1 en lpp

Ejercicio 2 Java