0
The program needs to enter the value of notes. When typing, the program must return number of notes 20,10,5 1
/* Code in Java */
import java.util.Scanner;
class HelloWorld {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n;
int notas[] = {20, 10, 5, 1};
int numeroNotas[]={0,0,0,0};
int i;
System.out.println("Digite o numero:");
n = sc.nextInt();
while(n!=0){
System.out.println("Digite o numero:");
n = sc.nextInt();
}
for(i=0;i<=notas.length-1;i++){
System.out.println(" notas de "+notas[i]+" ="+numeroNotas[i]);
}
}
private static int conversor(int []notas,int n, int numeroNotas[]){
int i=0;
while(n%notas[i]==0){
i++;
}
numeroNotas[i]=numeroNotas[i]+1;
return i;
}
}
And what is your doubt?
– user28595
how to return the number of notes
– Orlando