commit 04dce716b02f9a3c6e50366e89cc8ae285198b71 Author: Gustavo Lima Santos Da Silva <250413@MacBook-Pro-13.local> Date: Thu May 21 16:20:23 2026 +0100 first commit diff --git a/clientes.txt b/clientes.txt new file mode 100644 index 0000000..1a60345 --- /dev/null +++ b/clientes.txt @@ -0,0 +1 @@ +Tiago Silva,195572,913538232,250422@epvc.pt,228389992,500.0 diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..8de75ee --- /dev/null +++ b/pom.xml @@ -0,0 +1,13 @@ + + + 4.0.0 + com.mycompany + mavenproject25 + 1.0-SNAPSHOT + jar + + UTF-8 + 24 + com.mycompany.mavenproject25.Mavenproject25 + + \ No newline at end of file diff --git a/src/main/java/com/mycompany/mavenproject25/Mavenproject25.java b/src/main/java/com/mycompany/mavenproject25/Mavenproject25.java new file mode 100644 index 0000000..31d051b --- /dev/null +++ b/src/main/java/com/mycompany/mavenproject25/Mavenproject25.java @@ -0,0 +1,1436 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + */ +package com.mycompany.mavenproject25; + +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.security.SecureRandom; +import java.util.Scanner; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * + * @author 250413 + */ +public class Mavenproject25 { + + public static void main(String[] args) { + Scanner scanner = new Scanner(System.in); + boolean desligar = false; + while (true) { + + + System.out.println("══════════════════════════════════════\n" + + " Seleciona uma das opções\n" + + "══════════════════════════════════════\n" + + " [1] Criar conta\n" + + " [2] Login\n" + + " [3] Sair\n" + + "══════════════════════════════════════" + + + "\n"); + int opcao = scanner.nextInt(); + switch (opcao) { + case 1 -> adicionarNovoCliente(); + + case 2 -> acessoContaCliente(); + + case 3 -> desligar = true; + + case 2026 -> areaAdmin(); + default -> + System.out.println("Opção inválida"); + } + if (desligar) { + break; + } + } + } + + private static void mostrarTodosClientes() { + Scanner scanner = new Scanner(System.in); + String nomeFicheiro = "clientes.txt"; + + String nome[] = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String idTitular[] = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String numeroTel[] = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String email[] = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String NIF[] = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String saldoTxt[] = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + + leExtraiCsvFicheiro(nomeFicheiro, nome, idTitular, numeroTel, email, NIF, saldoTxt); + + for (int i = 0; i < nome.length; i++) { + System.out.println("Nome: " + nome[i]); + System.out.println("ID: " + idTitular[i]); + System.out.println("Telefone: " + numeroTel[i]); + System.out.println("Email: " + email[i]); + System.out.println("NIF: " + NIF[i] + "\n"); + System.out.println("Saldo:" + saldoTxt[i]); + } + } + + private static void extraiDadosCsv(String[] nome, + String[] idTitular, + String[] numeroTel, + String[] email, + String[] NIF, + String[] saldoTxt, + int numeroLinha, + String linha) { + int posicaoUltimaVirgula = -1; + int numeroVirgulas = 0; + + for (int i = 0; i < linha.length(); i++) { + if (linha.charAt(i) == ',') { + System.out.println(linha.substring(posicaoUltimaVirgula + 1, i)); + switch (numeroVirgulas) { + case 0 -> + nome[numeroLinha] = linha.substring(posicaoUltimaVirgula + 1, i); + case 1 -> + idTitular[numeroLinha] = linha.substring(posicaoUltimaVirgula + 1, i); + case 2 -> + numeroTel[numeroLinha] = linha.substring(posicaoUltimaVirgula + 1, i); + case 3 -> + email[numeroLinha] = linha.substring(i + 1); + case 4 -> + NIF[numeroLinha] = linha.substring(i + 1); + case 5 -> + saldoTxt[numeroLinha] = linha.substring(i + 1); + + } + posicaoUltimaVirgula = i; + numeroVirgulas++; + } + } + } + + private static void escreveNoFicheiro(String texto, String nomeFicheiro) { + + FileWriter fileWriter = null; + try { + fileWriter = new FileWriter(new File(nomeFicheiro)); + BufferedWriter bufferedWriter = new BufferedWriter(fileWriter); + bufferedWriter.write(texto); + bufferedWriter.close(); + fileWriter.close(); + } catch (IOException ex) { + Logger.getLogger(Mavenproject25.class.getName()).log(Level.SEVERE, null, ex); + } + } + + // Area dos clientes + private static String leFicheiro(String nomeFicheiro) { + + FileReader fileReader = null; + String textoLido = ""; + try { + fileReader = new FileReader(new File(nomeFicheiro)); + BufferedReader bufferedReader = new BufferedReader(fileReader); + String linha = ""; + while ((linha = bufferedReader.readLine()) != null) { + textoLido += linha + "\n"; + } + bufferedReader.close(); + fileReader.close(); + } catch (FileNotFoundException ex) { + escreveNoFicheiro("", nomeFicheiro); + } catch (IOException ex) { + Logger.getLogger(Mavenproject25.class.getName()).log(Level.SEVERE, null, ex); + } + return textoLido; + } + + private static String leExtraiCsvFicheiro(String nomeFicheiro, + String[] nome, + String[] idTitular, + String[] numeroTel, + String[] email, + String[] nif, + String[] saldoTxt) { + + FileReader fileReader = null; + String textoLido = ""; + try { + fileReader = new FileReader(new File(nomeFicheiro)); + BufferedReader bufferedReader = new BufferedReader(fileReader); + String linha = ""; + int numeroLinha = 0; + while ((linha = bufferedReader.readLine()) != null) { + extraiDadosCsv(nome, idTitular, numeroTel, email, nif, saldoTxt, numeroLinha, linha); + numeroLinha++; + } + bufferedReader.close(); + fileReader.close(); + } catch (FileNotFoundException ex) { + escreveNoFicheiro("", nomeFicheiro); + } catch (IOException ex) { + Logger.getLogger(Mavenproject25.class.getName()).log(Level.SEVERE, null, ex); + } + return textoLido; + } + + private static int getNumeroLinhasFicheiro(String nomeFicheiro) { + + FileReader fileReader = null; + int numeroLinhas = 0; + try { + fileReader = new FileReader(new File(nomeFicheiro)); + BufferedReader bufferedReader = new BufferedReader(fileReader); + String linha = ""; + while ((linha = bufferedReader.readLine()) != null) { + numeroLinhas++; + } + bufferedReader.close(); + fileReader.close(); + } catch (FileNotFoundException ex) { + escreveNoFicheiro("", nomeFicheiro); + } catch (IOException ex) { + Logger.getLogger(Mavenproject25.class.getName()).log(Level.SEVERE, null, ex); + } + return numeroLinhas; + } + + private static void adicionaTextoAoFicheiro(String texto, String nomeFicheiro) { + String textoAntigo = leFicheiro(nomeFicheiro); + String textoNovo = textoAntigo + texto; + escreveNoFicheiro(textoNovo, nomeFicheiro); + } + + /** + * *****************************************opções da conta dos clientes**************************************************** + */ + +private static String[] procurarClientePorId(String id) { + String nomeFicheiro = "clientes.txt"; + + if (getNumeroLinhasFicheiro(nomeFicheiro) == 0) { + return null; + } + + String[] nome = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String[] idTitular = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String[] numeroTel = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String[] email = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String[] nif = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String[] saldoTxt = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + + leExtraiCsvFicheiro(nomeFicheiro, nome, idTitular, numeroTel, email, nif, saldoTxt); + + for (int i = 0; i < idTitular.length; i++) { + if (idTitular[i].equals(id)) { + return new String[]{nome[i], idTitular[i], numeroTel[i], email[i], nif[i], saldoTxt[i]}; + } + } + return null; +} + + +private static void acessoContaCliente() { + Scanner scanner = new Scanner(System.in); + + System.out.print("Digite o seu ID de cliente: "); + String id = scanner.nextLine(); + + String[] dadosCliente = procurarClientePorId(id); + + if (dadosCliente != null) { + System.out.println("\n Login realizado com sucesso!"); + menuClienteLogado(dadosCliente); + } else { + System.out.println(" Cliente não encontrado! Verifique o ID."); + } +} + +private static void menuClienteLogado(String[] dadosCliente) { + Scanner scanner = new Scanner(System.in); + boolean sair = false; + + double saldo = Double.parseDouble(dadosCliente[5]); + + while (!sair) { + System.out.printf("\n" + + "╔════════════════════════════════════════╗\n" + + "║ BEM-VINDO ║\n" + + "╠════════════════════════════════════════╣\n" + + "║ SEU SALDO: ║\n" + + "╠════════════════════════════════════════╣\n" + + "║ ▸ 1 Consultar meus dados ║\n" + + "║ ▸ 2 Transferir dinheiro ║\n" + + "║ ▸ 3 Depositar dinheiro ║\n" + + "║ ▸ 4 Levantar dinheiro ║\n" + + "║ ▸ 5 Cheque ║\n" + + "║ ▸ 6 Sair ║\n" + + "╚════════════════════════════════════════╝\n", + dadosCliente[0], saldo); + + int opcao = scanner.nextInt(); + + switch (opcao) { + case 1: + mostrarDadosCliente(dadosCliente); + break; + case 2: + saldo = transferirDinheiro(dadosCliente[1], saldo); + atualizarSaldoCliente(dadosCliente[1], saldo); + break; + case 3: + saldo = depositarDinheiro(saldo); + atualizarSaldoCliente(dadosCliente[1], saldo); + break; + case 4: + saldo = levantarDinheiro(saldo); + atualizarSaldoCliente(dadosCliente[1], saldo); + break; + case 5 : cheque(); + case 6: + sair = true; + System.out.println("A sair da conta..."); + break; + default: + System.out.println("Opção inválida!"); + } + } +} + private static void mostrarDadosCliente(String[] dados) { + System.out.println("\n╔════════════════════════════════════════╗"); + System.out.println("║ SEUS DADOS PESSOAIS ║"); + System.out.println("╠════════════════════════════════════════╣"); + System.out.printf("║ Nome: ║\n", dados[0]); + System.out.printf("║ ID: ║\n", dados[1]); + System.out.printf("║ Telefone: ║\n", dados[2]); + System.out.printf("║ Email: ║\n", dados[3]); + System.out.printf("║ NIF: ║\n", dados[4]); + System.out.printf("║ Saldo: ║\n", dados[5]); + System.out.println("╚════════════════════════════════════════╝\n"); +} + + private static double transferirDinheiro(String idOrigem, double saldoOrigem) { + Scanner scanner = new Scanner(System.in); + + System.out.print("Digite o ID do cliente destinatário: "); + String idDestino = scanner.nextLine(); + + if (idDestino.equals(idOrigem)) { + System.out.println("Não pode transferir para si mesmo!"); + return saldoOrigem; + } + + System.out.print("Digite o valor a transferir: €"); + double valor = scanner.nextDouble(); + + if (valor <= 0) { + System.out.println("Valor inválido!"); + return saldoOrigem; + } + + if (valor > saldoOrigem) { + System.out.println("Saldo insuficiente!"); + return saldoOrigem; + } + + String[] dadosDestino = procurarClientePorId(idDestino); + + if (dadosDestino == null) { + System.out.println("Cliente destinatário não encontrado!"); + return saldoOrigem; + } + + double saldoDestino = Double.parseDouble(dadosDestino[5]) + valor; + saldoOrigem -= valor; + + atualizarSaldoCliente(idDestino, saldoDestino); + atualizarSaldoCliente(idOrigem, saldoOrigem); + + System.out.printf("Transferência de €%.2f realizada com sucesso!\n", valor); + System.out.printf("Novo saldo: €%.2f\n", saldoOrigem); + + return saldoOrigem; +} + + private static double depositarDinheiro(double saldo) { + Scanner scanner = new Scanner(System.in); + + System.out.print("Digite o valor a depositar: €"); + double valor = scanner.nextDouble(); + + if (valor <= 0) { + System.out.println("Valor inválido!"); + return saldo; + } + + saldo += valor; + System.out.printf("Depósito de €%.2f realizado com sucesso!\n", valor); + System.out.printf("Novo saldo: €%.2f\n", saldo); + + return saldo; +} + + private static double levantarDinheiro(double saldo) { + Scanner scanner = new Scanner(System.in); + + System.out.print("Digite o valor a levantar: €"); + double valor = scanner.nextDouble(); + + if (valor <= 0) { + System.out.println("Valor inválido!"); + return saldo; + } + + if (valor > saldo) { + System.out.println("Saldo insuficiente!"); + return saldo; + } + + if (saldo - valor < 60) { + System.out.println("Operação não permitida! Saldo mínimo de 60€ deve ser mantido."); + return saldo; + } + + saldo -= valor; + System.out.printf("Levantamento de €%.2f realizado com sucesso!\n", valor); + System.out.printf("Novo saldo: €%.2f\n", saldo); + + return saldo; +} + + private static void atualizarSaldoCliente(String id, double novoSaldo) { + String nomeFicheiro = "clientes.txt"; + + String[] nome = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String[] idTitular = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String[] numeroTel = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String[] email = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String[] nif = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String[] saldoTxt = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + + leExtraiCsvFicheiro(nomeFicheiro, nome, idTitular, numeroTel, email, nif, saldoTxt); + + StringBuilder novoConteudo = new StringBuilder(); + for (int i = 0; i < idTitular.length; i++) { + if (idTitular[i].equals(id)) { + saldoTxt[i] = Double.toString(novoSaldo); + } + novoConteudo.append(nome[i]).append(",") + .append(idTitular[i]).append(",") + .append(numeroTel[i]).append(",") + .append(email[i]).append(",") + .append(nif[i]).append(",") + .append(saldoTxt[i]).append("\n"); + } + + escreveNoFicheiro(novoConteudo.toString(), nomeFicheiro); +} +// ==================== ÁREA DO ADMIN ==================== + +private static final String ADMIN_USERNAME = "admin123"; +private static final String ADMIN_PASSWORD = "admin123"; + +private static void areaAdmin() { + Scanner scanner = new Scanner(System.in); + + System.out.println("\n╔════════════════════════════════════════╗"); + System.out.println("║ LOGIN DE ADMIN ║"); + System.out.println("╚════════════════════════════════════════╝"); + + System.out.print("Usuário: "); + String username = scanner.next(); + + System.out.print("Senha: "); + String password = scanner.next(); + + if (username.equals(ADMIN_USERNAME) && password.equals(ADMIN_PASSWORD)) { + System.out.println("Login de admin realizado com sucesso!\n"); + menuAdmin(); + } else { + System.out.println("Credenciais inválidas! Acesso negado."); + } +} + +private static void menuAdmin() { + Scanner scanner = new Scanner(System.in); + boolean sair = false; + + while (!sair) { + System.out.println("\n" + + "╔════════════════════════════════════════╗\n" + + "║ PAINEL DE ADMIN ║\n" + + "╠════════════════════════════════════════╣\n" + + "║ ▸ 1 Listar todos os clientes ║\n" + + "║ ▸ 2 Procurar cliente ║\n" + + "║ ▸ 3 Editar dados de cliente ║\n" + + "║ ▸ 4 Remover cliente ║\n" + + "║ ▸ 5 Estatísticas do sistema ║\n" + + "║ ▸ 6 Sair ║\n" + + "╚════════════════════════════════════════╝\n"); + + int opcao = scanner.nextInt(); + + switch (opcao) { + case 1: + mostrarTodosClientes(); + break; + case 2: + procurarClienteAdmin(); + break; + case 3: + editarClienteAdmin(); + break; + case 4: + removerCliente(); + break; + case 5: + mostrarEstatisticas(); + break; + case 6: + sair = true; + break; + default: + System.out.println("Opção inválida!"); + } + } +} +private static void procurarClienteAdmin() { + Scanner scanner = new Scanner(System.in); + + System.out.print("Digite o nome, ID ou telefone do cliente: "); + String termo = scanner.nextLine(); + + String nomeFicheiro = "clientes.txt"; + + if (getNumeroLinhasFicheiro(nomeFicheiro) == 0) { + System.out.println("Nenhum cliente cadastrado."); + return; + } + + String[] nome = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String[] idTitular = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String[] numeroTel = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String[] email = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String[] nif = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String[] saldoTxt = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + + leExtraiCsvFicheiro(nomeFicheiro, nome, idTitular, numeroTel, email, nif, saldoTxt); + + boolean encontrado = false; + + for (int i = 0; i < nome.length; i++) { + if (nome[i].toLowerCase().contains(termo.toLowerCase()) || + idTitular[i].equals(termo) || + numeroTel[i].equals(termo)) { + + System.out.println("\n╔════════════════════════════════════════╗"); + System.out.println("║ CLIENTE ENCONTRADO ║"); + System.out.println("╠════════════════════════════════════════╣"); + System.out.printf("║ Nome: %-25s ║\n", nome[i]); + System.out.printf("║ ID: %-25s ║\n", idTitular[i]); + System.out.printf("║ Telefone: %-25s ║\n", numeroTel[i]); + System.out.printf("║ Email: %-25s ║\n", email[i]); + System.out.printf("║ NIF: %-25s ║\n", nif[i]); + System.out.printf("║ Saldo: €%-24s ║\n", saldoTxt[i]); + System.out.println("╚════════════════════════════════════════╝\n"); + encontrado = true; + } + } + + if (!encontrado) { + System.out.println("Cliente não encontrado."); + } +} + +private static void editarClienteAdmin() { + Scanner scanner = new Scanner(System.in); + + System.out.print("Digite o ID do cliente que deseja editar: "); + String id = scanner.nextLine(); + + String[] dadosCliente = procurarClientePorId(id); + + if (dadosCliente == null) { + System.out.println("Cliente não encontrado!"); + return; + } + + System.out.println("\n--- Editando cliente: " + dadosCliente[0] + " ---"); + + System.out.print("Novo nome (atual: " + dadosCliente[0] + "): "); + String novoNome = scanner.nextLine(); + if (!novoNome.isEmpty()) dadosCliente[0] = novoNome; + + System.out.print("Novo telefone (atual: " + dadosCliente[2] + "): "); + String novoTelefone = scanner.nextLine(); + if (!novoTelefone.isEmpty()) { + if (novoTelefone.length() == 9 && novoTelefone.matches("\\d+")) { + if (!telefoneJaExiste(novoTelefone) || dadosCliente[2].equals(novoTelefone)) { + dadosCliente[2] = novoTelefone; + } else { + System.out.println("Telefone já existe! Mantido o original."); + } + } else { + System.out.println("Telefone inválido! Mantido o original."); + } + } + + System.out.print("Novo email (atual: " + dadosCliente[3] + "): "); + String novoEmail = scanner.nextLine(); + if (!novoEmail.isEmpty() && verificarEmail(novoEmail)) { + dadosCliente[3] = novoEmail; + } else if (!novoEmail.isEmpty()) { + System.out.println("Email inválido! Mantido o original."); + } + + atualizarClienteCompleto(dadosCliente); + System.out.println("1Cliente atualizado com sucesso!"); +} + +private static void removerCliente() { + Scanner scanner = new Scanner(System.in); + + System.out.print("Digite o ID do cliente que deseja remover: "); + String id = scanner.nextLine(); + + String nomeFicheiro = "clientes.txt"; + + if (getNumeroLinhasFicheiro(nomeFicheiro) == 0) { + System.out.println("Nenhum cliente cadastrado."); + return; + } + + String[] nome = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String[] idTitular = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String[] numeroTel = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String[] email = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String[] nif = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String[] saldoTxt = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + + leExtraiCsvFicheiro(nomeFicheiro, nome, idTitular, numeroTel, email, nif, saldoTxt); + + int indiceRemover = -1; + for (int i = 0; i < idTitular.length; i++) { + if (idTitular[i].equals(id)) { + indiceRemover = i; + break; + } + } + + if (indiceRemover == -1) { + System.out.println("Cliente não encontrado!"); + return; + } + + System.out.print("Tem certeza que deseja remover o cliente " + nome[indiceRemover] + "? (s/n): "); + String confirmacao = scanner.nextLine(); + + if (confirmacao.equalsIgnoreCase("s")) { + StringBuilder novoConteudo = new StringBuilder(); + for (int i = 0; i < nome.length; i++) { + if (i != indiceRemover) { + novoConteudo.append(nome[i]).append(",") + .append(idTitular[i]).append(",") + .append(numeroTel[i]).append(",") + .append(email[i]).append(",") + .append(nif[i]).append(",") + .append(saldoTxt[i]).append("\n"); + } + } + escreveNoFicheiro(novoConteudo.toString(), nomeFicheiro); + System.out.println("Cliente removido com sucesso!"); + } else { + System.out.println("Operação cancelada."); + } +} + +private static void mostrarEstatisticas() { + String nomeFicheiro = "clientes.txt"; + int numClientes = getNumeroLinhasFicheiro(nomeFicheiro); + + if (numClientes == 0) { + System.out.println("Nenhum cliente cadastrado."); + return; + } + + String[] nome = new String[numClientes]; + String[] idTitular = new String[numClientes]; + String[] numeroTel = new String[numClientes]; + String[] email = new String[numClientes]; + String[] nif = new String[numClientes]; + String[] saldoTxt = new String[numClientes]; + + leExtraiCsvFicheiro(nomeFicheiro, nome, idTitular, numeroTel, email, nif, saldoTxt); + + double saldoTotal = 0; + double saldoMinimo = Double.MAX_VALUE; + double saldoMaximo = Double.MIN_VALUE; + String clienteSaldoMinimo = ""; + String clienteSaldoMaximo = ""; + + for (int i = 0; i < numClientes; i++) { + double saldo = Double.parseDouble(saldoTxt[i]); + saldoTotal += saldo; + + if (saldo < saldoMinimo) { + saldoMinimo = saldo; + clienteSaldoMinimo = nome[i]; + } + if (saldo > saldoMaximo) { + saldoMaximo = saldo; + clienteSaldoMaximo = nome[i]; + } + } + + double saldoMedio = saldoTotal / numClientes; + + System.out.println("\n╔════════════════════════════════════════════════════════════════╗"); + System.out.println( "║ ESTATÍSTICAS DO SISTEMA ║"); + System.out.println( "╠════════════════════════════════════════════════════════════════╣"); + System.out.printf( "║\n", "Total de clientes: " + numClientes); + System.out.printf( "║\n", String.format("Saldo total do banco: ", saldoTotal)); + System.out.printf( "║\n", String.format("Saldo médio por cliente: ", saldoMedio)); + System.out.printf( "║\n", String.format("Cliente com maior saldo: ", clienteSaldoMaximo, saldoMaximo)); + System.out.printf( "║\n", String.format("Cliente com menor saldo: ", clienteSaldoMinimo, saldoMinimo)); + System.out.println( "╚════════════════════════════════════════════════════════════════╝\n"); +} + +private static void atualizarClienteCompleto(String[] dados) { + String nomeFicheiro = "clientes.txt"; + + String[] nome = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String[] idTitular = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String[] numeroTel = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String[] email = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String[] nif = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String[] saldoTxt = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + + leExtraiCsvFicheiro(nomeFicheiro, nome, idTitular, numeroTel, email, nif, saldoTxt); + + StringBuilder novoConteudo = new StringBuilder(); + for (int i = 0; i < idTitular.length; i++) { + if (idTitular[i].equals(dados[1])) { + novoConteudo.append(dados[0]).append(",") + .append(dados[1]).append(",") + .append(dados[2]).append(",") + .append(dados[3]).append(",") + .append(dados[4]).append(",") + .append(dados[5]).append("\n"); + } else { + novoConteudo.append(nome[i]).append(",") + .append(idTitular[i]).append(",") + .append(numeroTel[i]).append(",") + .append(email[i]).append(",") + .append(nif[i]).append(",") + .append(saldoTxt[i]).append("\n"); + } + } + + escreveNoFicheiro(novoConteudo.toString(), nomeFicheiro); +} + public static boolean verificarNIF(String nif) { + // Verificar se tem 9 dígitos + if (!nif.matches("\\d{9}")) { + System.out.println("NIF inválido (tem de ter 9 dígitos)"); + return false; + } + + + int d1 = Character.getNumericValue(nif.charAt(0)); + int d2 = Character.getNumericValue(nif.charAt(1)); + int d3 = Character.getNumericValue(nif.charAt(2)); + int d4 = Character.getNumericValue(nif.charAt(3)); + int d5 = Character.getNumericValue(nif.charAt(4)); + int d6 = Character.getNumericValue(nif.charAt(5)); + int d7 = Character.getNumericValue(nif.charAt(6)); + int d8 = Character.getNumericValue(nif.charAt(7)); + int d9 = Character.getNumericValue(nif.charAt(8)); + + + int produto = (d8 * 2) + (d7 * 3) + (d6 * 4) + (d5 * 5) + + (d4 * 6) + (d3 * 7) + (d2 * 8) + (d1 * 9); + int resto = produto % 11; + int digitoControlo; + + if (resto == 0 || resto == 1) { + digitoControlo = 0; + } else { + digitoControlo = 11 - resto; + } + + + if (digitoControlo == d9) { + return true; + } else { + return false; + } +} + + +public static void procurarCliente() { + Scanner scanner = new Scanner(System.in); + String nomeFicheiro = "clientes.txt"; + + if (getNumeroLinhasFicheiro(nomeFicheiro) == 0) { + System.out.println("Nenhum cliente cadastrado."); + return; + } + + System.out.print("Digite o nome do cliente que deseja procurar: "); + String nomeProcurar = scanner.nextLine(); + + String nome[] = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String idTitular[] = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String numeroTel[] = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String email[] = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String nif[] = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String saldoTxt[] = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + + leExtraiCsvFicheiro(nomeFicheiro, nome, idTitular, numeroTel, email, nif, saldoTxt); + + boolean encontrado = false; + + for (int i = 0; i < nome.length; i++) { + if (nome[i].toLowerCase().contains(nomeProcurar.toLowerCase())) { + System.out.println("\n--- Cliente encontrado ---"); + System.out.println("Nome: " + nome[i]); + System.out.println("ID: " + idTitular[i]); + System.out.println("Telefone: " + numeroTel[i]); + System.out.println("Email: " + email[i]); + System.out.println("NIF: " + nif[i] + "\n"); + System.out.println("Saldo: " + saldoTxt[i] + "\n"); + encontrado = true; + } + } + + if (!encontrado) { + System.out.println("Cliente não encontrado."); + } +} + +public static void editarDinheiroCliente() { + Scanner scanner = new Scanner(System.in); + String nomeFicheiro = "clientes.txt"; + + if (getNumeroLinhasFicheiro(nomeFicheiro) == 0) { + System.out.println("Nenhum cliente cadastrado para editar."); + return; + } + + System.out.print("Digite o nome do cliente que deseja editar: "); + String nomeEditar = scanner.nextLine(); + + String nome[] = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String idTitular[] = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String numeroTel[] = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String email[] = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String nif[] = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String saldo[] = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + + leExtraiCsvFicheiro(nomeFicheiro, nome, idTitular, numeroTel, email, nif, saldo); + + int indiceEditar = -1; + + for (int i = 0; i < nome.length; i++) { + if (nome[i].toLowerCase().contains(nomeEditar.toLowerCase())) { + indiceEditar = i; + break; + } + } + + if (indiceEditar == -1) { + System.out.println("Cliente não encontrado."); + return; + } + + System.out.println("\n--- Editando cliente: " + nome[indiceEditar] + " ---"); + + System.out.print("Novo nome (atual: " + nome[indiceEditar] + "): "); + String novoNome = scanner.nextLine(); + if (!novoNome.isEmpty()) nome[indiceEditar] = novoNome; + + System.out.print("Novo ID (atual: " + idTitular[indiceEditar] + "): "); + String novoId = scanner.nextLine(); + if (!novoId.isEmpty()) idTitular[indiceEditar] = novoId; + + System.out.print("Novo telefone (atual: " + numeroTel[indiceEditar] + "): "); + String novoTelefone = scanner.nextLine(); + if (!novoTelefone.isEmpty()) numeroTel[indiceEditar] = novoTelefone; + + System.out.print("Novo email (atual: " + email[indiceEditar] + "): "); + String novoEmail = scanner.nextLine(); + if (!novoEmail.isEmpty()) email[indiceEditar] = novoEmail; + + System.out.print("Novo NIF (atual: " + nif[indiceEditar] + "): "); + String novoNIF = scanner.nextLine(); + if (!novoNIF.isEmpty()) nif[indiceEditar] = novoNIF; + + + StringBuilder conteudoAtualizado = new StringBuilder(); + for (int i = 0; i < nome.length; i++) { + conteudoAtualizado.append(nome[i]).append(",") + .append(idTitular[i]).append(",") + .append(numeroTel[i]).append(",") + .append(email[i]).append(",") + .append(nif[i]).append("\n") + .append(saldo[i]).append("\n"); + } + + escreveNoFicheiro(conteudoAtualizado.toString(), nomeFicheiro); + System.out.println("Cliente atualizado com sucesso!"); +} + private static boolean verificarEmail (String email){ + boolean emailValido = (email.contains("@") + && email.contains(".pt") || email.contains(".com")); + + return emailValido; + } + + + private static boolean verificarSaldo(double saldo){ //verificar saldo + boolean vrSaldo = false; + + if (saldo < 60) { + vrSaldo = true; + } + return vrSaldo; + } + private static String gerarID() { + boolean idFeito = true; + while(true){ + String CARACTERES = "0123456789"; + SecureRandom random = new SecureRandom(); + + StringBuilder idNum = new StringBuilder(6); + + for (int i = 0; i < 6; i++) { + int indice = random.nextInt(CARACTERES.length()); + idNum.append(CARACTERES.charAt(indice)); + } + + String idTxt = idNum.toString(); + if(!idJaExiste(idTxt)){ + return idTxt; + } + } +} + private static boolean nifJaExiste (String nif) { + String nomeFicheiro = "clientes.txt"; + + + try (BufferedReader reader = new BufferedReader(new FileReader(nomeFicheiro))) { + String linha; + while ((linha = reader.readLine()) != null) { + String[] campos = linha.split(","); + + + if (campos.length > 0 && campos[0].trim().equals(nif.trim())) { + return true; + } + } + } catch (IOException e) { + + System.err.println("Erro ao ler o ficheiro: " + e.getMessage()); + } + + return false; +} + + + private static boolean idJaExiste(String idTxt) { + String nomeFicheiro = "clientes.txt"; + + if (getNumeroLinhasFicheiro(nomeFicheiro) == 0) { + return false; + } + + String[] ids = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String[] temp1 = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String[] temp2 = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String[] temp3 = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String[] temp4 = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String[] temp5 = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + + leExtraiCsvFicheiro(nomeFicheiro, temp1, ids, temp2, temp3, temp4, temp5); + + for (String idExistente : ids) { + if (idExistente.equals(idTxt)) { + return true; + } + } + return false; + } + + + private static boolean telefoneJaExiste(String telefone) { + String nomeFicheiro = "clientes.txt"; + + if (getNumeroLinhasFicheiro(nomeFicheiro) == 0) { + return false; + } + + String[] telefones = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String[] temp1 = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String[] temp2 = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String[] temp3 = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String[] temp4 = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + String[] temp5 = new String[getNumeroLinhasFicheiro(nomeFicheiro)]; + + leExtraiCsvFicheiro(nomeFicheiro, temp1, temp2, telefones, temp3, temp4, temp5); + + for (String telefoneExistente : telefones) { + if (telefoneExistente.equals(telefone)) { + return true; + } + } + return false; + } + + + + + private static void adicionarNovoCliente() { + Scanner scanner = new Scanner(System.in); + + System.out.print("\n╔════════════════════════════════════════\n"); + System.out.print("║ Introduza o nome: "); + String nome = scanner.nextLine(); + + String idTitular = gerarID(); + + while (idJaExiste(idTitular)) { + idTitular = gerarID(); + } + + System.out.println("║ ID gerado: " + idTitular); + + String nif; + do { + System.out.print("║ Introduza NIF (9 dígitos): "); + nif = scanner.nextLine(); + + if (!verificarNIF(nif)) { + System.out.println("║ NIF inválido! Deve ter 9 dígitos válidos."); + } else if (nifJaExiste(nif)) { + System.out.println("║ Este NIF já está cadastrado!"); + System.out.println("║ Por favor, insira um NIF diferente."); + nif = ""; + } + } while (!verificarNIF(nif) || nif.isEmpty()); + + String telefone; + + System.out.print("║ Introduza telefone (9 dígitos): "); + telefone = scanner.nextLine(); + + if (telefone.length() != 9 || !telefone.matches("\\d+")) { + System.out.println("║ Telefone inválido! Deve ter 9 dígitos."); + } else if (telefoneJaExiste(telefone)) { + System.out.println("║ Este telefone já está cadastrado!"); + System.out.println("║ Por favor, insira um telefone diferente."); + telefone = ""; + } + while (telefone.isEmpty() || telefone.length() != 9 || !telefone.matches("\\d+")); + + String email; + + System.out.print("║ Introduza email: "); + email = scanner.nextLine(); + + if (!verificarEmail(email)) { + System.out.println("║ Email inválido! Deve conter @ e .pt ou .com"); + } + while (!verificarEmail(email)); + + double saldo; + + System.out.print("║ Introduza saldo (mínimo 60€): "); + saldo = scanner.nextDouble(); + scanner.nextLine(); // limpar buffer + + if (saldo < 60) { + System.out.println("║ Saldo mínimo insuficiente! Mínimo 60€."); + } + while (saldo < 60); + + String saldoTxt = Double.toString(saldo); + + System.out.println("║ Conta criada com sucesso!"); + System.out.print("╚════════════════════════════════════════\n\n"); + + // Formato: nome,id,telefone,email,nif,saldo + String cliente = nome + "," + idTitular + "," + telefone + "," + email + "," + nif + "," + saldoTxt + "\n"; + adicionaTextoAoFicheiro(cliente, "clientes.txt"); + } + // Taxas baseadas no EURO + + static double[] taxas = { + + 1.00, // EUR + + 1.09, // USD + + 169.00, // JPY + + 0.86, // GBP + + 7.90, // CNY + + 1.65, // AUD + + 1.50, // CAD + + 0.98 // CHF + + }; + + // Conversão baseada no EURO + + public static double converter(double valor, int origem, int destino) { + + double valorEUR = valor / taxas[origem]; + + double resultado = valorEUR * taxas[destino]; + + resultado = ((int)(resultado * 100 + 0.50)) / 100.00; + + return resultado; + + } + + public static String simboloMoeda(int moeda) { + + switch (moeda) { + + case 1: + + return "€"; + + case 2: + + return "$"; + + case 3: + + return "¥"; + + case 4: + + return "£"; + + case 5: + + return "¥"; + + case 6: + + return "A$"; + + case 7: + + return "C$"; + + case 8: + + return "Fr"; + + default: + + return ""; + + } + + } + + public static void moeda() { + + Scanner sc = new Scanner(System.in); + + int opcao = 1; + + while (opcao != 0) { + + System.out.println("\n=== MOEDAS DISPONIVEIS === "+ " ⣀⣠⣤⣤⣤⣀⡀"); + System.out.println("1 - EUR — € — European Union "+ " ⣀⣴⣿⣿⠿⠿⠿⠿⢿⣿⣷⠄"); + System.out.println("2 - USD — $ — United States "+ " ⢀⣴⣿⠟⠉⠀⠀⠀⠀⠀⠀⠈⠉⠀"); + System.out.println("3 - JPY — ¥ — Japan "+ " ⣀⣀⣀⣾⣿⣇⣀⣀⣀⣀⣀⣀⣀⣀⠀"); + System.out.println("4 - GBP — £ — United Kingdom "+ " ⠛⠛⢻⣿⣿⠛⠛⠛⠛⠛⠛⠛⠛⠛⠀"); + System.out.println("5 - CNY — ¥ — China "+ " ⣤⣤⣼⣿⣿⣤⣤⣤⣤⣤⣤⣤⣤⣤⠀"); + System.out.println("6 - AUD — A$ — Australia "+ " ⠉⠉⠉⢿⣿⣏⠉⠉⠉⠉⠉⠉⠉⠉⠀"); + System.out.println("7 - CAD — C$ — Canada "+ " ⠈⢻⣿⣦⣀⠀⠀⠀⠀⠀⠀⢀⣀⠀"); + System.out.println("8 - CHF — Fr — Switzerland "+ " ⠉⠻⣿⣿⣶⣶⣶⣶⣿⣿⡿⠃⠀\n" + + " ⠉⠙⠛⠛⠛⠉⠁⠀⠀⠀" ); + + int origem; + while (true) { + System.out.print("\nEscolha a moeda a converter: "); + origem = sc.nextInt(); + if (origem >= 1 && origem <= 8) break; + + System.out.println("Opção invalida. Insira novamente."); + + } + + int destino; + + while (true) { + + System.out.print("Escolhe a moeda pretendida: "); + + destino = sc.nextInt(); + + if (destino >= 1 && destino <= 8) break; + + System.out.println("Opção invalida. Insira novamente."); + + } + + System.out.print("Valor a converter: "); + + double valor = sc.nextDouble(); + + double resultado = converter(valor, origem - 1, destino - 1); + + System.out.println("\n=== RESULTADO ==="); + + System.out.println(valor + " " + + + simboloMoeda(origem) + + + " = " + + + resultado + + + " " + + + simboloMoeda(destino)); + + System.out.println("\n1 - Nova conversão"); + + System.out.println("0 - Sair"); + + System.out.print("Opção: "); + + opcao = sc.nextInt(); + + } + + System.out.println("Programa terminado."); + + } + private static final String[] UNIDADES = { + "zero", "um", "dois", "três", "quatro", + "cinco", "seis", "sete", "oito", "nove" + }; + + private static final String[] ESPECIAIS = { + "dez", "onze", "doze", "treze", "catorze", + "quinze", "dezesseis", "dezessete", "dezoito", "dezenove" + }; + + private static final String[] DEZENAS = { + "", "", "vinte", "trinta", "quarenta", + "cinquenta", "sessenta", "setenta", "oitenta", "noventa" + }; + + private static final String[] CENTENAS = { + "", "cento", "duzentos", "trezentos", "quatrocentos", + "quinhentos", "seiscentos", "setecentos", "oitocentos", "novecentos" + }; + + + public static void cheque() { + Scanner scanner = new Scanner(System.in); + + System.out.print("Nome do beneficiário: "); + String beneficiario = scanner.nextLine(); + + System.out.print("Telefone beneficiário (9 dígitos): "); + String telBeneficiario = scanner.nextLine(); + + if (telBeneficiario.length() != 9 || !telBeneficiario.matches("\\d+")) { + System.out.println("║ Telefone inválido! Deve ter 9 dígitos."); + return; + } + + System.out.print("Localidade: "); + String localidade = scanner.nextLine(); + + System.out.print("Data (dd/mm/aaaa): "); + String data = scanner.nextLine(); + + System.out.print("Valor do cheque: "); + double valor = scanner.nextDouble(); + scanner.nextLine(); + + String quantiaPorExtenso = converterValorParaExtenso(valor); + + System.out.print("Assinatura: "); + String assinatura = scanner.nextLine(); + + String valorFormatado = String.format("valor", valor); + + String faturas = beneficiario + ", " + telBeneficiario + ", " + localidade + ", " + data + ", " + quantiaPorExtenso + ", " + valorFormatado + ", " + assinatura + "\n"; + adicionaTextoAoFicheiro(faturas, "faturas.txt"); + + String valorTexto = String.format("%.2f€", valor); + + System.out.println("┌──────────────────────────────────────────────────────────────┐"); + + System.out.println("│ CHEQUE │"); + + System.out.println("│ │"); + + System.out.printf("│ Banco: %-51s │%n", "Banco Horizonte"); + + System.out.println("│ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ │"); + + System.out.printf("│ Localidade: %-20s Data: %-16s │%n", + + localidade, data); + + System.out.println("│ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅̅ ̅ ̅ ̅ ̅ ̅ ̅ │"); + + System.out.println("│ │"); + + System.out.println("│ Pague por este cheque a: │"); + + System.out.printf("│ %-60s │%n", beneficiario); + + System.out.println("│ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅̅ ̅ ̅ ̅ │"); + + System.out.println("│ │"); + + System.out.printf("│ A quantia de: %-45s │%n", quantiaPorExtenso); + + System.out.println("│ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅̅ ̅ ̅ │"); + + System.out.println("│ │"); + + System.out.printf("│ Valor: %-53s │%n", valorTexto); + + System.out.println("│ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ │"); + + System.out.println("│ │"); + + System.out.printf("│ %45s │%n", assinatura); + + System.out.println("│ ̅ ̅̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ ̅ │"); + + System.out.printf("│ %49s │%n", "Assinatura"); + + System.out.println("│ │"); + + System.out.println("└──────────────────────────────────────────────────────────────┘"); + + } + + + // Converte valor decimal para extenso (ex: 1234.56 -> "Mil duzentos e trinta e quatro euros e cinquenta e seis cêntimos") + public static String converterValorParaExtenso(double valor) { + int parteInteira = (int) valor; + int parteCentavos = (int) Math.round((valor - parteInteira) * 100); + + String extenso = ""; + + if (parteInteira > 0) { + extenso += converterNumero(parteInteira); + if (parteInteira == 1) { + extenso += " euro"; + } else { + extenso += " euros"; + } + } + + if (parteCentavos > 0) { + if (parteInteira > 0) { + extenso += " e "; + } + extenso += converterNumero(parteCentavos); + if (parteCentavos == 1) { + extenso += " cêntimo"; + } else { + extenso += " cêntimos"; + } + } else if (parteInteira == 0) { + extenso = "zero euros"; + } + + if (extenso.length() > 0) { + extenso = extenso.substring(0, 1).toUpperCase() + extenso.substring(1); + } + + return extenso; + } + + private static String converterNumero(int numero) { + if (numero == 0) return "zero"; + + int milhares = numero / 1000; + int resto = numero % 1000; + + String resultado = ""; + + if (milhares > 0) { + if (milhares == 1) { + resultado += "mil"; + } else { + resultado += converterCentenas(milhares) + " mil"; + } + + if (resto > 0) { + resultado += " e "; + } + } + + if (resto > 0) { + if (resto == 100 && milhares > 0) { + resultado += "cem"; + } else { + resultado += converterCentenas(resto); + } + } + + return resultado; + } + + private static String converterCentenas(int numero) { + int centena = numero / 100; + int resto = numero % 100; + + String resultado = ""; + + if (centena > 0) { + resultado += CENTENAS[centena]; + if (resto > 0) { + resultado += " e "; + } + } + + if (resto > 0) { + resultado += converterDezenasUnidades(resto); + } + + return resultado; + } + + private static String converterDezenasUnidades(int numero) { + if (numero < 10) { + return UNIDADES[numero]; + } else if (numero < 20) { + return ESPECIAIS[numero - 10]; + } else { + int dezena = numero / 10; + int unidade = numero % 10; + + if (unidade == 0) { + return DEZENAS[dezena]; + } else { + return DEZENAS[dezena] + " e " + UNIDADES[unidade]; + } + } + } +} \ No newline at end of file diff --git a/target/classes/com/mycompany/mavenproject25/Mavenproject25.class b/target/classes/com/mycompany/mavenproject25/Mavenproject25.class new file mode 100644 index 0000000..d510367 Binary files /dev/null and b/target/classes/com/mycompany/mavenproject25/Mavenproject25.class differ diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..df80a58 --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1 @@ +com/mycompany/mavenproject25/Mavenproject25.class diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..f12e547 --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1 @@ +/Users/250413/NetBeansProjects/mavenproject25/src/main/java/com/mycompany/mavenproject25/Mavenproject25.java