I tried a google search but I did not get an answer that would lighten my head, I'm starting to study java and I came across the following problem:
Create a Java program that reads 10 names and their salaries from the keyboard and then shows the name of the person with the highest and lowest salary.
Remembering that I have not yet done the part of the if at the end to compare, my very self-doubt is how to save different variables using the scanner.
Obriagdo from now on:
public static void main(String[] args) {
String nome1;
int salario1;
int contador = 0;
while (contador <= 15) {
System.out.println(" Qual o seu nome?");
Scanner nome = new Scanner(System.in);
nome1 = nome.next();
System.out.println(" Qual o seu salário?");
Scanner salario = new Scanner(System.in);
salario1 = salario.nextInt();
contador = (contador + 1);
}
}