I'm using do while loop
public class Program {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
float grades;
int subj,i = 1;
System.out.printf(" Enter how many subjects: ");
subj = input.nextInt();
do {
System.out.printf("\nEnter Grade [%d]: ", i);
i++;
}while(i <= subj);
grades = input.nextInt();
}
}
Output
Enter how many subjects: 5
Enter Grade [1]: can't go back here
Enter Grade [2]: can't go back here
Enter Grade [3]: can't go back here
Enter Grade [4]: can't go back here
Enter Grade [5]: I'm automatically here right after I run the project
Being new isn't an excuse so I did a research but most of them are one way.
I want to display multiple lines that can hold and accept inputs at the same time in runtime, it's like converting the lines into fields that can be edited or changed while at runtime.
Edit[1]: IDE is NetBeans 8.2
Edit[2]: I already have a working program of this (which is one way), it just came up to my mind and I kinda want to upgrade it.