Java program, what did I do wrong? : I am new to java and programming. I have sort of a grasp on the concept but not entirely sure. This problem uses a scanner to read from another file to get information on amount of energy produced.


<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-js -->

    import java.util.Scanner;
    import java.io.File;

    public class HJUnit3
    {
     public static void main(String[] args) throws Exception
     {
    //   Scanner stdIn = new Scanner(System.in);
       Scanner stdIn = new Scanner(new File("energyProduced.txt"));
            stdIn.nextLine();
    		double energy;
    		energy = stdIn.nextLine();
       int systemsCost;  //Total Systems Cost
       double ttlEnergy;  //Total energy produced in a week
       double savingsWeek;  //Total savings for one week
       double savingsDay;  //Total savings for one day
       double recoupDay;  //Days to recoup
       double recoupYear; //Years to recoup
       final double electricCost = 0.085;
       
       systemsCost = (savingsWeek * energy);
       System.out.println("Total System Cost = $" + systemsCost );
       System.out.println("Total Energy Produced in one week" + (energy * 7) + "Kwh");
       savingsWeek = (ttlEnergy * electricCost);
       System.out.println("Total Savings for one week =" + savingsWeek);
       savingsDay = (savingsWeek / 7);
       System.out.println("Total Savings for one day =" + savingsDay);
       recoupDay = (systemsCost / savingsDay);
       System.out.println("Days to recoup cost(truncated)" + recoupDay);
       recoupYear = (recoupDay / 365);
       System.out.println("Years to recoup cost(truncated)");
     } // end main
    } // end HJUnit3 class

<!-- end snippet -->
It gives me this error "error: incompatible types: String cannot be converted to double
                energy = stdIn.next();"



and this "error: incompatible types: possible lossy conversion from double to int
   systemsCost = (savingsWeek * energy);"


What did I do wrong, not really sure.