Centalyzer constructor not working

Can anyone tell me maybe why x isn’t being set to, “2574.3” and it’s being set to 0? Don’t hate, I’m new to java and coding in general.

Here is are the details, “Some coin bags will measure exactly the weight expected. For example, if there are 115
pre-1982 coins in the bag, the weight will be 2576 grams. Some coin bags will have coins
that are quite worn, and in this case the actual weight might be 2575.8 grams. Your
program should report the correct number of pre-1982 coins (115) for either test case.
Coins will never be so worn that the missing material accounts for more than 0.5 grams
in the bag of 1000 coins. Hint: use a for loop to try every mixture of pre- and post-1982
pennies possible and compare the the given weight of the bag. Don’t forget to include the
weight of the bag itself.”

import java.util.*;
public class TestCoins{
   public static void main(String args[]){
      // TEST CONDITION 1 – mixed bag – this number should produce output
      // as follows:
      // 113 pre
      // 887 post
      Centalyzer ca = new Centalyzer(2574.3);
      //**************************************************
      // TEST CONDITION 2 – bag of all pre 1982 coins –
      // this number should produce output
      // as follows:
      // 1000 pre
      // 0 post
      //**************************************************
      // NOTE: 7.0 = weight of bag, .49 maximum amt worn off
      //UN-COMMENT LINE BELOW FOR TEST 2
      //**************************************************
      //Centalyzer ca = new Centalyzer(3.1 * 1000 + 7.0-0.49);
      //**************************************************
      // TEST CONDITION 3 – bag of all post 1982 coins –
      // this number should produce output
      // as follows:
      // 0 pre
      // 1000 post
      //**************************************************
      //UN-COMMENT LINE CONSTRUCTING THE OBJECT BELOW FOR TEST 3
      // NOTE: 7.0 = weight of bag, .49 maximum amt worn off
      //**************************************************
      //Centalyzer ca = new Centalyzer(2.5 * 1000 + 7.0-0.49);
      System.out.println(ca.getPre1982() + " pre");
      System.out.println(ca.getPost1982() + " post");
      Scanner console = new Scanner(System.in);

   }
}
class Centalyzer{
    private double weight;
    private int oldCoin, newCoin;
    private double x;
    public Centalyzer(){
      x = 0;
    }
    public Centalyzer(double x){
      weight = x;
      double coinWeight = x - 7;

      for (int i = 0; i <= 1000; i++) {
         oldCoin = i;
         newCoin = 1000 - i;
         double testWeight = oldCoin * 3.1 + newCoin * 2.5;
         if (Math.abs(coinWeight - testWeight) < 0.01) {
                break;
         }

      }
    }
      public int getPre1982(){
         return oldCoin;
      }
      public int getPost1982(){
         return newCoin;
      }
}