A level gauge for a tank is to ().
举一反三
- In the tank there is a sending unit which tells the fuel gauge how much fuel is left in the tank.
- Some newer cars have a microprocessor that reads the variable resistor in the tank and communicates that reading to another microprocessor in the dashboard. Carmakers can tinker with the gauge movement a little --they can compensate for the shape of the tank by comparing the float position to a calibration curve.
- class Tank { int level; } public class TestTank { public static void main(String[] args) { Tank t1 = new Tank(); Tank t2 = new Tank(); t1.level = 9; t2.level = 47; System.out.println("1: t1.level: " + t1.level + ", t2.level: " + t2.level); t1 = t2; System.out.println("2: t1.level: " + t1.level + ", t2.level: " + t2.level); t1.level = 27; System.out.println("3: t1.level: " + t1.level + ", t2.level: " + t2.level); } }
- class Tank { int level; } public class TestTank { public static void main(String[] args) { Tank t1 = new Tank(); Tank t2 = new Tank(); t1.level = 9; t2.level = 47; System.out.println("1: t1.level: " + t1.level + ", t2.level: " + t2.level); t1 = t2; System.out.println("2: t1.level: " + t1.level + ", t2.level: " + t2.level); t1.level = 27; System.out.println("3: t1.level: " + t1.level + ", t2.level: " + t2.level); } }
- Auto instruments include ____. A: speedometer B: coolant temperature gauge C: tachometer D: fuel gauge