import java.util.Scanner;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.NoSuchElementException;
import java.util.InputMismatchException;
public class PopDen01{
public static void main(String[] args){
String filename = "countryData.txt";
File fileObj = new File( filename );
Scanner fileScanner = null;
try{
fileScanner = new Scanner(fileObj);
}catch(FileNotFoundException e){
System.err.println("Sorry, unable to open '" + filename + "':" + e.getMessage());
System.exit(1);
}
try{
String header = fileScanner.nextLine();
while( fileScanner.hasNext() ){
String countryId = fileScanner.next();
int population = fileScanner.nextInt();
double area = fileScanner.nextDouble();
double populationDensity = population / area;
System.out.println(countryId + "\t" + Math.round(populationDensity * 10.0) / 10.0);
}
}catch(InputMismatchException e){
System.err.println("Sorry, unable to parse the type '" + filename + "':" + e.getMessage());
}catch(NoSuchElementException e){
System.err.println("Sorry, unable to parse '" + filename + "':" + e.getMessage());
}
fileScanner.close();
}
}