import java.io.File; import java.io.FileNotFoundException; import java.io.PrintWriter; import java.util.Scanner; public class exerc3 { public static void main(String[] args) throws FileNotFoundException { // Prompt for the input and output file names Scanner console = new Scanner(System.in); System.out.print("Input file: "); String inputFileName = console.next(); // Construct the Scanner and PrintWriter objects for reading and writing File inputFile = new File(inputFileName); Scanner in = new Scanner(inputFile); // Output file System.out.print("Output file: "); String outputFileName = console.next(); PrintWriter out = new PrintWriter(outputFileName); // Read the input and write the output while (in.hasNextLine()) { String line = in.nextLine(); String [] parts=line.split(";"); System.out.println("Informe a idade do/a " + parts[1]); int idade= console.nextInt(); System.out.println("Informe o peso do/a " + parts[1]); double peso = console.nextDouble(); System.out.println("Informe a altura do/a " + parts[1]); double altura = console.nextDouble(); out.printf("%s;%d;%5.2f;%3.2f\r\n",line,idade,peso,altura); } in.close(); out.close(); } }