import java.util.Scanner;
public class Chapter2_10 {
public static void main(String[] args){
Scanner input = new Scanner(System.in);
System.out.println("Enter the amount of water in kilgrams: ");
double M = input.nextDouble();
System.out.println("Enter the initial temperature: ");
double initialTemperature = input.nextDouble();
System.out.println("Enter the final temperature: ");
double finalTemperature = input.nextDouble();
double Q = M * (finalTemperature - initialTemperature) * 4184;
System.out.println("The energy needed is " + Q);
}
}
import java.util.Scanner;
public class Chapter2_11 {
public static void main(String[] args){
Scanner input = new Scanner(System.in);
System.out.println("Enter the number of years: ");
int numberYears = input.nextInt();
int totalSeconds = numberYears * 365 * 24 * 3600;
int population = 312032486 + (int)((totalSeconds / 7.0) - (totalSeconds / 13.0) + (totalSeconds / 45.0));
System.out.println("The population in " + numberYears + " years is " + population);
}
}
import java.util.Scanner;public class Chapter2_10 { public static void main(String[] args){ Scanner input = new Scanner(System.in); System.out.println("Enter the amount of water in kilgrams: "); double M = input.nextDouble();.