import javax.swing.JOptionPane;
Public class FareMetrics{
Public FareMetrics(){
}
Public static void main (String [] args)
{
String kilometer;
faremetrics result = new faremetric();
double total;
kilometer = JOptionPane.showInputDialog ("Enter no. of kilometer:");
result.set kilometer(kilometer);
JOptionPane.showMessageDialog (null,"FareMetrics\n" + "No. of Kilometers:" + result.get
kilometer() + "Fare in Peso:" + result.get total ());
}
Class faremetrics
{
private string km;
private int t;
public string get kilometer () {
return km;
}
public void set kilometer (String k){
km=k
}
public double get total() {
total = ((kilometer /5) *20.00)+((kilometers%5)/.50);
return total;
}
i got this one :)
TumugonBurahinby the way thanks for the effort to post it here :)
Naalis ng may-ari ang komentong ito.
TumugonBurahinnakakatulong ito sa paggawa ng method at instance of a class
TumugonBurahinTHANKS FOR POSTING THIS..
TumugonBurahinI LEARN MORE TO JAVA..
tnx for the information
TumugonBurahintnx for posting our assignment..
TumugonBurahin