Advertisement
Kl43z

Digito Verificador Pseudocodigo

Oct 7th, 2014
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. Programa Dígito Verificador
  2.  
  3. {rut1,rut2,rut3,rut4,rut5,rut6,rut7,rut8,res1,res2,res3,res4,res5,res6,res7,res8,suma,rest,di_ve: Son Variables de tipo Entero}
  4.  
  5. INICIO
  6. Escribir "Ingrese el RUT, dígito por dígito, sin el dígito verificador: "
  7. Escribir "Ingrese 1° dígito: "
  8. Leer (rut1)
  9. Escribir "Ingrese 2° dígito: "
  10. Leer (rut2)
  11. Escribir "Ingrese 3° dígito: "
  12. Leer (rut3)
  13. Escribir "Ingrese 4° dígito: "
  14. Leer (rut4)
  15. Escribir "Ingrese 5° dígito: "
  16. Leer (rut5)
  17. Escribir "Ingrese 6° dígito: "
  18. Leer (rut6)
  19. Escribir "Ingrese 7° dígito: "
  20. Leer (rut7)
  21. Escribir "Ingrese 8° dígito: "
  22. Leer (rut8)
  23.  
  24. //multiplicacion
  25. res1<-rut8*2
  26. res2<-rut7*3
  27. res3<-rut6*4
  28. res4<-rut5*5
  29. res5<-rut4*6
  30. res6<-rut3*7
  31. res7<-rut2*2
  32. res8<-rut1*3
  33. //suma
  34. suma<-res1+res2+res3+res4+res5+res6+res7+res8
  35. //resto de division por 11
  36. rest<-suma mod 11
  37. di_ve<-11-rest
  38. si (di_ve=10) entonces
  39. Escribir "El digito verificador es: K "
  40. Escribir "RUT es: ",rut1,rut2,rut3,rut4,rut5,rut6,rut7,rut8
  41.  
  42. sino
  43. Escribir "El digito verificador es:", di_ve
  44. Escribir "RUT es: ",rut1,rut2,rut3,rut4,rut5,rut6,rut7,rut8,di_ve
  45. {Fin Condicional si}
  46.  
  47. FIN
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement