Sure! Here's a Java program that accomplishes what you described:
```java
import java.util.Scanner;
public class GradeCalculator {
public static void main(String[] args) {
// Create a Scanner object to read user input
Scanner scanner = new Scanner(System.in);
// Read the course code from the user
System.out.print("Enter your course code: ");
String courseCode = scanner.nextLine();
// Read the section from the user
System.out.print("Enter your section: ");
String section = scanner.nextLine();
// Read the scores of the exams from the user
System.out.print("Enter the scores of the tests and the final: ");
int midterm1 = scanner.nextInt();
int midterm2 = scanner.nextInt();
int finalExam = scanner.nextInt();
// Calculate the average grade
double average = (0.3 * midterm1) + (0.3 * midterm2) + (0.4 * finalExam);
// Display the final average grade along with the course code and section
System.out.println(courseCode + " " + section);
System.out.println("Final average grade: " + average);
}
}
```
To run this program, copy the code into a file named `GradeCalculator.java`. Then, open a command prompt or terminal in the same directory as the file and run the following commands:
```
javac GradeCalculator.java
java GradeCalculator
```
This will compile the Java code and run the program. You can then enter the course code, section, and exam scores as prompted, and the program will calculate and display the final average grade.