title: Java - Only Prints first name (i want full name) (another error included)
body: <p>I'm making a program that reads a person's name and age, and when "zzz" is entered, it prints the names and ages of everyone who's 18 or older. Also, I want to calculate the percentage of people who's 18 or older. But, here's the problem: the code i'm posting bellow, only prints the first name (example: "Ricardo Almeida" and age "19". Output: "Ricardo : 19", but i want "Ricardo Almeida : 19). <i>The percentage calculation has a error too but i cant figure out whats wrong. It gives 0 all the times. (DONE!)</i> Thanks in advance to anyone who's reading this and trying to help.</p>
  
  <p>PS: I dont want to use arrays! I already learned how to use them, but i want to know how to solve this without using them :)</p>
  
  <pre><code>package javaapplication38;
  import java.util.Scanner;
  public class JavaApplication38 {
  private static final Scanner in=new Scanner(System.in);
  
  private static String metodo1(String name, int age) {
      String frase="";
      if (age==18 | age&gt;18) {
          frase=String.format("%s : %d %n",name,age);
      }
      return frase;
  }
  
  public static void main(String[] args) {
     int age, counter1=0, counter2=0;
     String name, acumtxt="", aux;
  
     do {
          System.out.print("Name: ");
          name=in.next(); in.nextLine();
          if (!"ZZZ".equalsIgnoreCase(name)) {
              counter1++;
              do {
                  System.out.print("Age: ");
                  age=in.nextInt();
              } while (age&lt;=0);
              if (age==18 | age&gt;18) {
                  counter2++;
              }
              aux=metodo1(name,age);
              acumtxt+=aux;
          }
      } while(!"ZZZ".equalsIgnoreCase(name));
  
      System.out.print(acumtxt);
      if (counter1&gt;0) {
              System.out.println("The percentage of people who's 18 or older is "+ (counter2/counter1) +"%.");
              }
      }
  </code></pre>
  
  <p>}</p>