Task 5 (20 pts.)
import java.util.Scanner;
public class Casting {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.printf("Please enter a double number: ");
double a = in.nextDouble();
int a1 = a;
System.out.printf("a cast into an int becomes %d.\n", a1);
}
}
The above program is an incorrect attempt to do the following:
Fix the above program, so that it runs correctly. Save your corrected program as Casting.java. You do NOT have to explain what is wrong, it is sufficient to submit your corrected Casting.java.
For example: if the user enters 15.23, your program output should look EXACTLY like this:
Please enter a double number: 15.23 a cast into an int becomes 15.
As another example: if the user enters -12.87, your program output should look EXACTLY like this:
Please enter a double number: -12.87 a cast into an int becomes -12.
Your program's output should match EXACTLY the format shown above. There should be no deviations, no extra spaces or lines, no extra punctuation in your output. What you see above as uppercase letters should remain uppercase in your output, what you see as lowercase letters should remain as lowercase in your output, what you see as spaces and punctuation should remain exactly as spaces and punctuation in your output.
import java.util.Scanner;
public class Casting {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.printf("Please enter a double number: ");
double a = in.nextDouble();
int a1 = (int)a;
System.out.printf("a cast into an int becomes %d.\n", a1);
}
}

Task 5 (20 pts.) import java.util.Scanner; public class Casting { public static void main(String[] args) {...