import java.util.Scanner; public class Test { public static void main(String[] args) { try { double z = calc(); System.out.println(z); } catch (Exception e) { System.out.println("Det skjedde en feil. Pr?v p? nytt."); } } static double calc() throws Exception{ Scanner sc = new Scanner(System.in); System.out.println("Skriv inn et tall: "); double x = sc.nextInt(); System.out.println("Skriv inn et tall: "); double y = sc.nextInt(); double z = x / y; return z; } }