public class CricketDemo { public static void main(String[] args) { Cricket cricket = new Cricket(33); System.out.println("Fahrenheit == " + cricket.fahrenheit()); System.out.println(); MetricCricket metriccricket = new MetricCricket(33); System.out.println("Celsius == " + metriccricket.celsius()); System.out.println("Fahrenheit == " + metriccricket.fahrenheit()); System.out.println(); KelvinCricket kelvincricket = new KelvinCricket(33); System.out.println("Kelvin == " + kelvincricket.kelvin()); System.out.println("Celsius == " + kelvincricket.celsius()); System.out.println("Fahrenheit == " + kelvincricket.fahrenheit()); System.out.println(); System.out.println(cricket); System.out.println(metriccricket); System.out.println(kelvincricket); System.exit(0); } } class Cricket { int chirps; //per 15 seconds public Cricket(int chirps) { this.chirps = chirps; } public String toString() { return chirps + " chirps per 15 seconds"; } public double fahrenheit() { return chirps + 39; } } class MetricCricket extends Cricket { public MetricCricket(int chirps) { super(chirps); } //inherits the toString and fahrenheit methods of class Cricket. public double celsius() { return (fahrenheit() - 32) * 5 / 9; } } class KelvinCricket extends MetricCricket { public KelvinCricket(int chirps) { super(chirps); } //inherits the toString, fahrenheit, and celsius methods //of class MetricCricket. public double kelvin() { return celsius() + 273.15; } }