This program is basically working with text files, reading the data & performing functions:
while(s.hasNext()){
name= s.next();
mark= s.nextDouble()
Elliot's answer is of course correct, but for completeness' sake it's worth noting that if you don't want to print the value immediately, but instead hold the String for some other usage, you could use the DecimalFormat class:
DecimalFormat df = new DecimalFormat("##.##%");
double percent = (mark / tm);
String formattedPercent = df.format(percent);