import java.util.Scanner;

public class main {
public static void main(String[] args) {
Scanner wins = new Scanner(System.in);
Scanner games = new Scanner(System.in);
double q, w, e;

System.out.println("Enter Wins: ");
q = wins.nextInt();
System.out.println("Total games: ");
w = games.nextInt();
e=q/w*100;
System.out.println("Your win rate is: " + e + "%");
if(e>79){
System.out.println("Class A");
}
else if (e>59){
System.out.println("Class B");
}
else if (e>39){
System.out.println("Class C");
}
else {
System.out.println("Class D");
}
}
}

This Java code prompts the user to enter the number of wins and total games played. It then calculates the win rate by dividing the number of wins by the total games and multiplying by 100. Finally, it determines the class based on the win rate.

To use this code, you need to follow these steps:

1. Include the necessary import statement at the beginning of your code:
```java
import java.util.Scanner;
```

2. Create an instance of the Scanner class to read input from the user:
```java
Scanner wins = new Scanner(System.in);
Scanner games = new Scanner(System.in);
```

3. Declare the variables q, w, and e to store the wins, total games, and win rate, respectively:
```java
double q, w, e;
```

4. Prompt the user to enter the number of wins and assign the input to variable q:
```java
System.out.println("Enter Wins: ");
q = wins.nextInt();
```

5. Prompt the user to enter the total games and assign the input to variable w:
```java
System.out.println("Total games: ");
w = games.nextInt();
```

6. Calculate the win rate by dividing the number of wins by the total games and multiplying by 100:
```java
e = q / w * 100;
```

7. Print the win rate to the console:
```java
System.out.println("Your win rate is: " + e + "%");
```

8. Use conditional statements to determine the class based on the win rate:
```java
if (e > 79) {
System.out.println("Class A");
} else if (e > 59) {
System.out.println("Class B");
} else if (e > 39) {
System.out.println("Class C");
} else {
System.out.println("Class D");
}
```

9. Test the code by running the `main` method. You can enter the number of wins and total games when prompted, and the code will calculate the win rate and determine the class.

Make sure to compile and run the code in a Java development environment to see the output.