Advertisement
Re_21

repasoexamen

Jun 14th, 2023
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 22.96 KB | None | 0 0
  1. /*
  2.  * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
  3.  * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
  4.  */
  5. package com.mycompany.repaso_examen_final;
  6.  
  7. /**
  8.  *
  9.  * @author victo
  10.  */
  11. public class CitasPoo {
  12.  
  13.     private String CUI;
  14.     private String Nombres;
  15.     private String Apellidos;
  16.     private String fNacimiento;
  17.     private String genero;
  18.     private String nEspecialidad;
  19.  
  20.     public CitasPoo(String CUI, String Nombres, String Apellidos, String fNacimiento, String genero, String nEspecialidad) {
  21.         this.CUI = CUI;
  22.         this.Nombres = Nombres;
  23.         this.Apellidos = Apellidos;
  24.         this.fNacimiento = fNacimiento;
  25.         this.genero = genero;
  26.         this.nEspecialidad = nEspecialidad;
  27.     }
  28.  
  29.     public String getCUI() {
  30.         return CUI;
  31.     }
  32.  
  33.     public String getNombres() {
  34.         return Nombres;
  35.     }
  36.  
  37.     public String getApellidos() {
  38.         return Apellidos;
  39.     }
  40.  
  41.     public String getfNacimiento() {
  42.         return fNacimiento;
  43.     }
  44.  
  45.     public String getGenero() {
  46.         return genero;
  47.     }
  48.  
  49.     public String getnEspecialidad() {
  50.         return nEspecialidad;
  51.     }
  52.  
  53.     @Override
  54.     public String toString() {
  55.         return "CitasPoo{" + "CUI=" + CUI + ", Nombres=" + Nombres + ", Apellidos=" + Apellidos + ", fNacimiento=" + fNacimiento + ", genero=" + genero + ", nEspecialidad=" + nEspecialidad + '}';
  56.     }
  57.  
  58. }
  59.  
  60. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  61. /*
  62.  * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
  63.  * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
  64.  */
  65. package com.mycompany.repaso_examen_final;
  66.  
  67. /**
  68.  *
  69.  * @author victo
  70.  */
  71. import java.io.*;
  72.  
  73. public class ArchivosSecuenciales {
  74. //archivo nuevo cocn la fecha
  75. // \ <- quitar
  76.     //
  77.     //colas
  78.  
  79.     public static void llenarCita(CitasPoo cita, BufferedWriter bW) throws IOException {
  80.         bW.write(cita.getCUI() + "%" + cita.getNombres() + "%" + cita.getApellidos() + "%" + cita.getfNacimiento() + "%" + cita.getGenero() + "%" + cita.getnEspecialidad());
  81.         bW.newLine();
  82.         bW.close();
  83.     }
  84.     public static void registrarCita(CitasPoo cita, String fecha) throws IOException {
  85.         File file = new File("Cita_" + fecha + ".txt");
  86.         //agrega
  87.         if (!file.exists()) {
  88.             file.createNewFile();
  89.         }
  90.         if (file.exists() && file.length() != 0) {
  91.             BufferedWriter bW = new BufferedWriter(new FileWriter(file, true));
  92.             llenarCita(cita, bW);
  93.             //sobreescribe
  94.         } else {
  95.             BufferedWriter bW = new BufferedWriter(new FileWriter(file));
  96.             llenarCita(cita, bW);
  97.         }
  98.     }
  99. }
  100. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  101. /*
  102.  * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
  103.  */
  104. package com.mycompany.repaso_examen_final;
  105.  
  106. /**
  107.  *
  108.  * @author victo
  109.  */
  110. import java.util.*;
  111. import java.io.*;
  112.  
  113. //main
  114. public class Repaso_examen_final {
  115.  
  116.     //instanciar colas
  117.     Queue<CitasPoo> colaOdonto = new LinkedList();
  118.     Queue<CitasPoo> colaGastro = new LinkedList();
  119.     Queue<CitasPoo> colaDerma = new LinkedList();
  120.     Queue<CitasPoo> colaNeuro = new LinkedList();
  121.  
  122.     public static void main(String[] args) throws IOException {
  123.         //llamar al main para ejecutar metodos
  124.         Repaso_examen_final main = new Repaso_examen_final();
  125.         Scanner entrada = new Scanner(System.in);
  126.         System.out.println("Ingrese una opcion: \n 1.Registrar \n 2. Cargar \n 3. Mostrar \n 4. Atender Odonto \n 5. Atender Gastro \n 6. Atender Derma \n 7. Atender Neuro");
  127.         String opcion = entrada.nextLine();
  128.         while (!opcion.equals("9")) {
  129.             switch (opcion) {
  130.                 case "1":
  131.                     System.out.println("Ingrese un cui");
  132.                     String Cui = entrada.nextLine();
  133.                     if (validarCui(Cui) == true) {
  134.                         System.out.println("Ingrese los nombres");
  135.                         String nombres = entrada.nextLine();
  136.                         System.out.println("Ingrese los apellidos");
  137.                         String apellidos = entrada.nextLine();
  138.                         System.out.println("Ingrese una fecha");
  139.                         String fecha = entrada.nextLine();
  140.                         if (validarFecha(fecha) == true) {
  141.                             fecha = fecha.replace('/', ' ').trim();
  142.                             System.out.println("Ingrese un genero");
  143.                             String genero = entrada.nextLine();
  144.                             System.out.println("Ingrese un numero de especialidad \n 1. Odontologia. \n 2. Gastroenterologia. \n 3. Odontologia. \n 4. Neurologia");
  145.                             String nEspecialidad = entrada.nextLine();
  146.                             CitasPoo cita = new CitasPoo(Cui, nombres, apellidos, fecha, genero, nEspecialidad);
  147.                             ArchivosSecuenciales.registrarCita(cita, fecha);
  148.                         }
  149.                     }
  150.                     break;
  151.                 case "2":
  152.                     System.out.println("Ingrese una fecha");
  153.                     String fecha = entrada.nextLine();
  154.                     fecha = fecha.replace('/', ' ').trim();
  155.                     main.cargarCitas(fecha);
  156.                     opcion = "8";
  157.                     break;
  158.                 case "3":
  159.                     main.mostrarCitas();
  160.                     opcion = "8";
  161.                     break;
  162.                 case "4":
  163.                     main.atenderOdonto();
  164.                     opcion = "8";
  165.                     break;
  166.                 case "5":
  167.                     main.atenderGastro();
  168.                     opcion = "8";
  169.                     break;
  170.                 case "6":
  171.                     main.atenderDerma();
  172.                     opcion = "8";
  173.                     break;
  174.                 case "7":
  175.                     main.atenderNeuro();
  176.                     opcion = "8";
  177.                     break;
  178.                 case "8":
  179.                     System.out.println("Ingrese una opcion");
  180.                     opcion = entrada.nextLine();
  181.                     break;
  182.             }
  183.         }
  184.         //validar cui
  185.         //validar fecha
  186.     }
  187.  
  188.     //colas metodos
  189.     public void cargarCitas(String fecha) throws IOException {
  190.         File file = new File("Cita_" + fecha + ".txt");
  191.         if (file.exists()) {
  192.             BufferedReader bR = new BufferedReader(new FileReader(file));
  193.             String linea;
  194.             while ((linea = bR.readLine()) != null) {
  195.                 String[] CitasAtributos = linea.split("%");
  196.                 CitasPoo citas = new CitasPoo(CitasAtributos[0], CitasAtributos[1], CitasAtributos[2], CitasAtributos[3], CitasAtributos[4], CitasAtributos[5]);
  197.                 switch (citas.getnEspecialidad()) {
  198.                     case "1":
  199.                         colaOdonto.add(citas);
  200.                         System.out.println(colaOdonto);
  201.                         break;
  202.                     case "2":
  203.                         colaGastro.add(citas);
  204.                         break;
  205.                     case "3":
  206.                         colaDerma.add(citas);
  207.                         break;
  208.                     case "4":
  209.                         colaNeuro.add(citas);
  210.                         break;
  211.                 }
  212.             }
  213.             //leerArchivo.close();
  214.             System.out.println("Citas cargadas");
  215.         }
  216.     }
  217.  
  218.     public void mostrarCitas() {
  219.         for (CitasPoo citas : colaOdonto) {
  220.             System.out.println(citas.toString());
  221.         }
  222.         for (CitasPoo citas : colaGastro) {
  223.             System.out.println(citas.toString());
  224.         }
  225.         for (CitasPoo citas : colaDerma) {
  226.             System.out.println(citas.toString());
  227.         }
  228.         for (CitasPoo citas : colaNeuro) {
  229.             System.out.println(citas.toString());
  230.         }
  231.     }
  232.  
  233.     //atender citas
  234.     public void atenderDerma() {
  235.  
  236.         while (!colaDerma.isEmpty()) {
  237.             CitasPoo cita = colaDerma.remove();
  238.         }
  239.     }
  240.  
  241.     public void atenderGastro() {
  242.  
  243.         while (!colaGastro.isEmpty()) {
  244.             CitasPoo cita = colaGastro.remove();
  245.         }
  246.     }
  247.  
  248.     public void atenderOdonto() {
  249.         while (!colaOdonto.isEmpty()) {
  250.             CitasPoo cita = colaOdonto.remove();
  251.         }
  252.     }
  253.  
  254.     public void atenderNeuro() {
  255.         while (!colaNeuro.isEmpty()) {
  256.             CitasPoo cita = colaNeuro.remove();
  257.         }
  258.     }
  259.  
  260.     public static boolean buscarArchivo(String ultDigitos) throws IOException {
  261.         boolean bandera = false;
  262.         BufferedReader br = new BufferedReader(new FileReader("DepartamentosMunicipios.txt"));
  263.         String linea;
  264.         while ((linea = br.readLine()) != null) {
  265.             //Leemos cada linea del archivo para comprobar que los ultimos 4 caracteres del cui existan en el archivo
  266.             if (linea.length() >= 4) {
  267.                 String codigo = linea.substring(0, 4);
  268.                 if (codigo.equalsIgnoreCase(ultDigitos)) {
  269.                     bandera = !bandera;
  270.                     break;
  271.                 }
  272.             }
  273.         }
  274.         return bandera;
  275.     }
  276.  
  277.     public static boolean validarCui(String cui) throws IOException {
  278.         int contador = 0;
  279.         boolean bandera = false;
  280.  
  281.         if (cui.length() == 13 && cui.charAt(0) != '0') {
  282.             for (int i = 0; i < cui.length(); i++) {
  283.                 switch (cui.charAt(i)) {
  284.                     case '0':
  285.                     case '1':
  286.                     case '2':
  287.                     case '3':
  288.                     case '4':
  289.                     case '5':
  290.                     case '6':
  291.                     case '7':
  292.                     case '8':
  293.                     case '9':
  294.                         contador++;
  295.                         break;
  296.  
  297.                 }
  298.             }
  299.             if (contador == cui.length()) {
  300.                 if (buscarArchivo(cui.substring(9, 13))) {
  301.                     bandera = !bandera;
  302.                 }
  303.             }
  304.         }
  305.         return bandera;
  306.     }
  307.  
  308.     public static boolean validarFecha(String fecha) {
  309.         //dd/mm/yyyy 01/34/6789 = 10
  310.         int contador = 0;
  311.         boolean bandera = false;
  312.         if (fecha.charAt(2) == '/' && fecha.charAt(5) == '/' && fecha.length() == 10) {
  313.             for (int i = 0; i < fecha.length(); i++) {
  314.                 switch (fecha.charAt(i)) {
  315.                     case '0':
  316.                     case '1':
  317.                     case '2':
  318.                     case '3':
  319.                     case '4':
  320.                     case '5':
  321.                     case '6':
  322.                     case '7':
  323.                     case '8':
  324.                     case '9':
  325.                     case '/':
  326.                         contador++;
  327.                         break;
  328.                 }
  329.             }
  330.             if (contador == fecha.length()) {
  331.                 bandera = !bandera;
  332.             }
  333.         }
  334.         return bandera;
  335.     }
  336.     /*
  337.        public static boolean validarNIT(String nit) {
  338.         // Asegurarse de que el NIT tenga 10 caracteres
  339.         if (nit.length() >= 2 && nit.length() <= 13) {
  340.             // Realizar validación adicional si es necesario
  341.  
  342.         } else {
  343.             return false;
  344.         }
  345.  
  346.         String partes[] = nit.split("-");
  347.  
  348.         String parte1 = partes[0];
  349.         String parte2 = partes[1];
  350.         // Separamos los primeros  dígitos del NIT, y el dígito verificador es el último
  351.         // String primerosocho = nit.substring(0, 8);
  352.         String digitoVerificador = parte2;
  353.  
  354.         int factor = parte1.length() + 1;
  355.         int valor = 0;
  356.         //10482781-5
  357.         //8+1=9 AQUI EMPIEZA EL FACTOR
  358.         //9*1=9 8*0=0 4*7=28 Y ASI SUSECIMAMENTE CON EL RESTO DE NUMEROS DEL NIT SIN INCLUIR EL DIGITO VERIFICADOR
  359.         for (int i = 0; i < parte1.length(); i++) {
  360.             // Convertimos carácter por carácter de los primeros 9 y los multiplicamos por el factor
  361.             valor += Character.getNumericValue(parte1.charAt(i)) * factor;
  362.             factor--;
  363.         }
  364.  
  365.         // A VALOR QUE ES EL NUMERO DE LA SUMA DE LAS MULTIPLICACIONES DEL FACTOR POR EL NIT SE LE SACA MOD 11
  366.         //System.out.println("este es el valor" + valor);
  367.         int residuo = valor % 11;
  368.         //System.out.println("aqui eta elresiduio" + residuo);
  369.         int resultado = 11 - residuo;
  370.         //System.out.println("aqui eta resultado" + resultado);
  371.  
  372.         if (resultado >= 10) {
  373.             resultado = 0;
  374.         }
  375.  
  376.         if (Integer.parseInt(digitoVerificador) == resultado) {
  377.             return true;
  378.         }
  379.  
  380.         return false;
  381.     }*/
  382. }
  383. /*
  384.  * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
  385.  */
  386. package com.mycompany.repaso_examen_final;
  387.  
  388. /**
  389.  *
  390.  * @author victo
  391.  */
  392. import java.util.*;
  393. import java.io.*;
  394.  
  395. //main
  396. public class Repaso_examen_final {
  397.  
  398.     //instanciar colas
  399.     Queue<CitasPoo> colaOdonto = new LinkedList();
  400.     Queue<CitasPoo> colaGastro = new LinkedList();
  401.     Queue<CitasPoo> colaDerma = new LinkedList();
  402.     Queue<CitasPoo> colaNeuro = new LinkedList();
  403.  
  404.     public static void main(String[] args) throws IOException {
  405.         //llamar al main para ejecutar metodos
  406.         Repaso_examen_final main = new Repaso_examen_final();
  407.         Scanner entrada = new Scanner(System.in);
  408.         System.out.println("Ingrese una opcion: \n 1.Registrar \n 2. Cargar \n 3. Mostrar \n 4. Atender Odonto \n 5. Atender Gastro \n 6. Atender Derma \n 7. Atender Neuro");
  409.         String opcion = entrada.nextLine();
  410.         while (!opcion.equals("9")) {
  411.             switch (opcion) {
  412.                 case "1":
  413.                     System.out.println("Ingrese un cui");
  414.                     String Cui = entrada.nextLine();
  415.                     if (validarCui(Cui) == true) {
  416.                         System.out.println("Ingrese los nombres");
  417.                         String nombres = entrada.nextLine();
  418.                         System.out.println("Ingrese los apellidos");
  419.                         String apellidos = entrada.nextLine();
  420.                         System.out.println("Ingrese una fecha");
  421.                         String fecha = entrada.nextLine();
  422.                         if (validarFecha(fecha) == true) {
  423.                             fecha = fecha.replace('/', ' ').trim();
  424.                             System.out.println("Ingrese un genero");
  425.                             String genero = entrada.nextLine();
  426.                             System.out.println("Ingrese un numero de especialidad \n 1. Odontologia. \n 2. Gastroenterologia. \n 3. Odontologia. \n 4. Neurologia");
  427.                             String nEspecialidad = entrada.nextLine();
  428.                             CitasPoo cita = new CitasPoo(Cui, nombres, apellidos, fecha, genero, nEspecialidad);
  429.                             ArchivosSecuenciales.registrarCita(cita, fecha);
  430.                         }
  431.                     }
  432.                     break;
  433.                 case "2":
  434.                     System.out.println("Ingrese una fecha");
  435.                     String fecha = entrada.nextLine();
  436.                     fecha = fecha.replace('/', ' ').trim();
  437.                     main.cargarCitas(fecha);
  438.                     opcion = "8";
  439.                     break;
  440.                 case "3":
  441.                     main.mostrarCitas();
  442.                     opcion = "8";
  443.                     break;
  444.                 case "4":
  445.                     main.atenderOdonto();
  446.                     opcion = "8";
  447.                     break;
  448.                 case "5":
  449.                     main.atenderGastro();
  450.                     opcion = "8";
  451.                     break;
  452.                 case "6":
  453.                     main.atenderDerma();
  454.                     opcion = "8";
  455.                     break;
  456.                 case "7":
  457.                     main.atenderNeuro();
  458.                     opcion = "8";
  459.                     break;
  460.                 case "8":
  461.                     System.out.println("Ingrese una opcion");
  462.                     opcion = entrada.nextLine();
  463.                     break;
  464.             }
  465.         }
  466.         //validar cui
  467.         //validar fecha
  468.     }
  469.  
  470.     //colas metodos
  471.     public void cargarCitas(String fecha) throws IOException {
  472.         File file = new File("Cita_" + fecha + ".txt");
  473.         if (file.exists()) {
  474.             BufferedReader bR = new BufferedReader(new FileReader(file));
  475.             String linea;
  476.             while ((linea = bR.readLine()) != null) {
  477.                 String[] CitasAtributos = linea.split("%");
  478.                 CitasPoo citas = new CitasPoo(CitasAtributos[0], CitasAtributos[1], CitasAtributos[2], CitasAtributos[3], CitasAtributos[4], CitasAtributos[5]);
  479.                 switch (citas.getnEspecialidad()) {
  480.                     case "1":
  481.                         colaOdonto.add(citas);
  482.                         System.out.println(colaOdonto);
  483.                         break;
  484.                     case "2":
  485.                         colaGastro.add(citas);
  486.                         break;
  487.                     case "3":
  488.                         colaDerma.add(citas);
  489.                         break;
  490.                     case "4":
  491.                         colaNeuro.add(citas);
  492.                         break;
  493.                 }
  494.             }
  495.             //leerArchivo.close();
  496.             System.out.println("Citas cargadas");
  497.         }
  498.     }
  499.  
  500.     public void mostrarCitas() {
  501.         for (CitasPoo citas : colaOdonto) {
  502.             System.out.println(citas.toString());
  503.         }
  504.         for (CitasPoo citas : colaGastro) {
  505.             System.out.println(citas.toString());
  506.         }
  507.         for (CitasPoo citas : colaDerma) {
  508.             System.out.println(citas.toString());
  509.         }
  510.         for (CitasPoo citas : colaNeuro) {
  511.             System.out.println(citas.toString());
  512.         }
  513.     }
  514.  
  515.     //atender citas
  516.     public void atenderDerma() {
  517.  
  518.         while (!colaDerma.isEmpty()) {
  519.             CitasPoo cita = colaDerma.remove();
  520.         }
  521.     }
  522.  
  523.     public void atenderGastro() {
  524.  
  525.         while (!colaGastro.isEmpty()) {
  526.             CitasPoo cita = colaGastro.remove();
  527.         }
  528.     }
  529.  
  530.     public void atenderOdonto() {
  531.         while (!colaOdonto.isEmpty()) {
  532.             CitasPoo cita = colaOdonto.remove();
  533.         }
  534.     }
  535.  
  536.     public void atenderNeuro() {
  537.         while (!colaNeuro.isEmpty()) {
  538.             CitasPoo cita = colaNeuro.remove();
  539.         }
  540.     }
  541.  
  542.     public static boolean buscarArchivo(String ultDigitos) throws IOException {
  543.         boolean bandera = false;
  544.         BufferedReader br = new BufferedReader(new FileReader("DepartamentosMunicipios.txt"));
  545.         String linea;
  546.         while ((linea = br.readLine()) != null) {
  547.             //Leemos cada linea del archivo para comprobar que los ultimos 4 caracteres del cui existan en el archivo
  548.             if (linea.length() >= 4) {
  549.                 String codigo = linea.substring(0, 4);
  550.                 if (codigo.equalsIgnoreCase(ultDigitos)) {
  551.                     bandera = !bandera;
  552.                     break;
  553.                 }
  554.             }
  555.         }
  556.         return bandera;
  557.     }
  558.  
  559.     public static boolean validarCui(String cui) throws IOException {
  560.         int contador = 0;
  561.         boolean bandera = false;
  562.  
  563.         if (cui.length() == 13 && cui.charAt(0) != '0') {
  564.             for (int i = 0; i < cui.length(); i++) {
  565.                 switch (cui.charAt(i)) {
  566.                     case '0':
  567.                     case '1':
  568.                     case '2':
  569.                     case '3':
  570.                     case '4':
  571.                     case '5':
  572.                     case '6':
  573.                     case '7':
  574.                     case '8':
  575.                     case '9':
  576.                         contador++;
  577.                         break;
  578.  
  579.                 }
  580.             }
  581.             if (contador == cui.length()) {
  582.                 if (buscarArchivo(cui.substring(9, 13))) {
  583.                     bandera = !bandera;
  584.                 }
  585.             }
  586.         }
  587.         return bandera;
  588.     }
  589.  
  590.     public static boolean validarFecha(String fecha) {
  591.         //dd/mm/yyyy 01/34/6789 = 10
  592.         int contador = 0;
  593.         boolean bandera = false;
  594.         if (fecha.charAt(2) == '/' && fecha.charAt(5) == '/' && fecha.length() == 10) {
  595.             for (int i = 0; i < fecha.length(); i++) {
  596.                 switch (fecha.charAt(i)) {
  597.                     case '0':
  598.                     case '1':
  599.                     case '2':
  600.                     case '3':
  601.                     case '4':
  602.                     case '5':
  603.                     case '6':
  604.                     case '7':
  605.                     case '8':
  606.                     case '9':
  607.                     case '/':
  608.                         contador++;
  609.                         break;
  610.                 }
  611.             }
  612.             if (contador == fecha.length()) {
  613.                 bandera = !bandera;
  614.             }
  615.         }
  616.         return bandera;
  617.     }
  618.     /*
  619.        public static boolean validarNIT(String nit) {
  620.         // Asegurarse de que el NIT tenga 10 caracteres
  621.         if (nit.length() >= 2 && nit.length() <= 13) {
  622.             // Realizar validación adicional si es necesario
  623.  
  624.         } else {
  625.             return false;
  626.         }
  627.  
  628.         String partes[] = nit.split("-");
  629.  
  630.         String parte1 = partes[0];
  631.         String parte2 = partes[1];
  632.         // Separamos los primeros  dígitos del NIT, y el dígito verificador es el último
  633.         // String primerosocho = nit.substring(0, 8);
  634.         String digitoVerificador = parte2;
  635.  
  636.         int factor = parte1.length() + 1;
  637.         int valor = 0;
  638.         //10482781-5
  639.         //8+1=9 AQUI EMPIEZA EL FACTOR
  640.         //9*1=9 8*0=0 4*7=28 Y ASI SUSECIMAMENTE CON EL RESTO DE NUMEROS DEL NIT SIN INCLUIR EL DIGITO VERIFICADOR
  641.         for (int i = 0; i < parte1.length(); i++) {
  642.             // Convertimos carácter por carácter de los primeros 9 y los multiplicamos por el factor
  643.             valor += Character.getNumericValue(parte1.charAt(i)) * factor;
  644.             factor--;
  645.         }
  646.  
  647.         // A VALOR QUE ES EL NUMERO DE LA SUMA DE LAS MULTIPLICACIONES DEL FACTOR POR EL NIT SE LE SACA MOD 11
  648.         //System.out.println("este es el valor" + valor);
  649.         int residuo = valor % 11;
  650.         //System.out.println("aqui eta elresiduio" + residuo);
  651.         int resultado = 11 - residuo;
  652.         //System.out.println("aqui eta resultado" + resultado);
  653.  
  654.         if (resultado >= 10) {
  655.             resultado = 0;
  656.         }
  657.  
  658.         if (Integer.parseInt(digitoVerificador) == resultado) {
  659.             return true;
  660.         }
  661.  
  662.         return false;
  663.     }*/
  664. }
  665.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement