daily pastebin goal
88%
SHARE
TWEET

Untitled

a guest Jan 13th, 2018 79 in 1 day
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2. import java.util.Formatter;
  3.  
  4. public class CURConverter {
  5.     public static void main(String[] args) {
  6.  
  7.         Scanner scan = new Scanner(System.in);
  8.         double usd = Double.parseDouble(scan.nextLine());
  9.         String str = scan.nextLine();
  10.         System.out.println(str);
  11.         String str1 = scan.nextLine();
  12.         System.out.println(str1);
  13.         double bgn = usd * 1.79549;
  14.         System.out.printf("%.2f BGN", bgn);
  15.  
  16.         double bg = Double.parseDouble(scan.nextLine());
  17.         String str2 = scan.nextLine();
  18.         System.out.println(str2);
  19.         String str3 = scan.nextLine();
  20.         System.out.println(str3);
  21.         double eur = bg / 1.95583;
  22.         System.out.printf("%.2f%n EUR", eur);
  23.  
  24.         double eu = Double.parseDouble(scan.nextLine());
  25.         String str4 = scan.nextLine();
  26.         System.out.println(str4);
  27.         String str5 = scan.nextLine();
  28.         System.out.println(str5);
  29.         double bgn2 = eu * 1.95583;
  30.         double gbp = bgn2 / 2.53405;
  31.         System.out.printf("%.2f%n GBP", gbp);
  32.  
  33.         double us = Double.parseDouble(scan.nextLine());
  34.         String str6 = scan.nextLine();
  35.         System.out.println(str6);
  36.         String str7 = scan.nextLine();
  37.         System.out.println(str7);
  38.         double bgn1 = us * 1.79549;
  39.         double eur1 = bgn1 / 1.95583;
  40.         System.out.printf("%.2f%n EUR", eur1);
  41.     }
  42.  
  43. }
  44.  
  45. ERROR MSG v JUDGE:
  46.  
  47. Exception in thread "main" java.util.NoSuchElementException: No line found
  48.     at java.util.Scanner.nextLine(Scanner.java:1540)
  49.     at CurConverter.main(CurConverter.java:19)
  50.     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  51.     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  52.     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  53.     at java.lang.reflect.Method.invoke(Method.java:498)
  54.     at _$SandboxExecutor.main(_$SandboxExecutor.java:38)
RAW Paste Data
Top