package AA; import java.util.Scanner; public class ah { public static void main(String[] args){ double kilograms=0,temperature1=0,temperature2; System.out.print("Enter the amount of water in kilograms:"); Scanner in=new Scanner(System.in); kilograms=in.nextDouble(); System.out.print("Enter the initial temperature:"); Scanner s=new Scanner(System.in); temperature1=s.nextDouble(); System.out.print("Enter the final temperature:"); Scanner m=new Scanner(System.in); temperature2=m.nextDouble(); double Q; Q = kilograms*(temperature2-temperature1)* 4184; System.out.print("The energy needed is "+String.format("%.1f",Q)); }