This program is basically working with text files, reading the data & performing functions:
while(s.hasNext()){
name= s.next();
mark= s.nextDouble();
double percent= (mark / tm )*100 ;
System.out.println("Student Name : " +name );
System.out.println("Percentage In Exam: " +percent+"%");
System.out.println(" ");
}
I would like to format the percent value to 2 decimal places but since it's inside a while loop I cannot use the printf.