|
thi is what i have so I don'y know whether I should write my calculating method in my classes that implements my interface and should I write my calculation method coz that is the only problem that is holding me back?? [code] public abstract class Measurement { private int value; protected String symbol; /** *Measurement's two argument construtor *@ param integer value and protected string. */ public Measurement(int v, String s) { value = v; symbol = s; } //set the value. public void setValue(int v) { value = v; } /** *method getValue *@ return Returns an integer. */ public int getValue() { return value; } //set symbol. public void setSymbol( String s) { symbol = s; } /** *method getsymbol *@ return Returns a string. */ protected String getSymbol() { return symbol; } //returns objects to measurement public String toString() { return String.format("Measurement:",getValue(),getSymbol()); } public abstract int isThermal();
} ============================== public interface ImperialConvertable { int getConvertToF(); } ======================== public interface MetricConvertable { int getConvertTok(); } ======================================== public class Celsius implements ImperialConvertable { } ============================ public class fahrenheit implements ImperialConvertable { } ====================== public class Delisle implements ImperialConvertable { } ============================== here is my question below
Attached File(s)
The_South_African_Weather_Service.doc ( 28.5k )
Number of downloads: 24
|