0

I have just started learning Java for first time. I have an issue when compiling the following code.

public class Conversion {
public static void main (String[] args) {

    double euros;
    double dollars;
    System.out.println("Sum in euros? ");
    euros = Terminal.lireDouble();
    dollars = euros * 1.118;
    System.out.println("Sum in dollars: ");
    System.out.println(dollars);
}

}

I get the following error message:

/Users/Mathieu/IdeaProjects/Conversion/src/com/company/Conversion.java:9:17 java: cannot find symbol symbol: variable Terminal location: class com.company.Conversion

Please, could you help me ? What is wrong with my code.

Thank you in advance

1 Answers1

1

In order to get input from the user use this

    import java.util.Scanner;
    public class Conversion {
    public static void main (String[] args) {
        Scanner in = new Scanner(System.in);
        double euros;
        double dollars;
        System.out.println("Sum in euros? ");
        euros = in.nextDouble();
        dollars = euros * 1.118;
        System.out.println("Sum in dollars: ");
        System.out.println(dollars);
    }
   }

Scanner is used to get input from the user

Tomer
  • 133
  • 1
  • 3
  • 9