~HAPPY BIRTHDAY JAVA!!~

~HAPPY BIRTHDAY JAVA!!~

Play with Us!


Via: Video Blog

Note: Don't Get Hit By Blue Balls! Keep your Red Square away from the Blue Balls on your way to the Green Zone or you'll DIE! And trust ME; you'll die. A lot.
HTML Comment Box is loading comments...

Lunes, Setyembre 10, 2012

Class Assignment

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;
}

6 (na) komento: