Okay so I am rewrite the program and it's still not coming right can anyone help me see what's going wrong here please I have to turn this in by tmw so here the program

The following program is supposed to read two numbers from a file named Ex20Input.txt, and write the sum of the number to a file named Ex20Output.dat. However, it fails to do so. Rewrite the program so that it performs correctly. (You may assume that both numbers are on the same line.)
Import Java.util.*;

public class Ch3Ex20
{
public static void main (String [] args)
{
Scanner inFile =
new Scanner (new FileReader ("Ex20Input.txt"));

Int num1, num2;

num1 = inFile.nextInt ();
num2 = inFile.nextInt ();

outFile.printIn ("Sum = " + (num1 + num2 ));

outFile.close ();
}
}
So I have change it to this way and it end up wrong still
import java.util.*;
public class Ch3Ex20
{
Scanner inFile =
new Scanner (new FileReader ("Ex20Input.txt"));

Int num1, num2;
num1 = inFile.nextInt ();
num2 = inFile.nextInt ();

PrintWrite outFile = new PrintWrite ("Ex20Output.out");

outFile.printIn ("Sum = + (num1 + num2));

outFile.close ();
}
}
So can someone help me fix this please

Of course, I can help you identify the issue in your code. The problem seems to be with your variable declarations and their usage. Here is a corrected version of your code:

```java
import java.util.*;
import java.io.*;

public class Ch3Ex20 {
public static void main (String [] args) {
try {
// Open input file
Scanner inFile = new Scanner(new File("Ex20Input.txt"));

// Read two numbers from the file
int num1 = inFile.nextInt();
int num2 = inFile.nextInt();

// Close input file
inFile.close();

// Calculate the sum
int sum = num1 + num2;

// Open output file
PrintWriter outFile = new PrintWriter("Ex20Output.dat");

// Write the sum to the output file
outFile.println("Sum = " + sum);

// Close output file
outFile.close();

} catch (FileNotFoundException e) {
System.out.println("File not found.");
}
}
}
```

Explanation of the changes made to your code:
1. Import `java.io.*` package to use `File` and `FileNotFoundException` classes.
2. Add a `try-catch` block to handle `FileNotFoundException` in case the input file is not found.
3. Replace `FileReader` with `File` in `Scanner` declaration to read from a file.
4. Declare `num1` and `num2` as `int` with lowercase `i`.
5. Create a `PrintWriter` object for the output file, with the correct filename and extension.
6. Use `println()` method to write the sum to the output file, instead of `printIn()`.
7. Close the input file and output file after usage.

Make sure to save your input numbers in `Ex20Input.txt` before running the program. The sum of the numbers will be written to the `Ex20Output.dat` file.

I hope this helps you fix the issue and complete your program successfully.