-1
Hello, I’m wanting to fill a vector using the useDelimiter
of Java. For now I only know how to fill a vector this way using for:
for (int i = 0; i < vet.length; i++) {
System.out.print("Digite um número: ");
vet[i] = s.nextInt();
soma += vet[i];
}
in this precise exercise calculate the average of the items within the vector.
The user input would be this:
3;9;4;5;8;0;1;8;5;1;3;2;6;4;7;
Researching I found the useDelimiter
as an alternative, but I still don’t understand how it could work in this scenario. If anyone can help me, I am very grateful!