Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Homework help with java!

Name: Anonymoud 2011-10-24 1:49

I need to fix this asap, its due in ten minutes, any help???

import javax.swing.JOptionPane;
import java.text.DecimalFormat;

public class Conversion
{
  public static void main(String[] args)
  {
    double meters;
    double kilometers;
    double inches;
    double feet;
    int number;
   
    public static int menu()
      {             
      String menu = "Enter a distance in meters:  " +
          "\n 1.) Convert to kilometers " +
          "\n 2.) Convert to inches " +
          "\n 3.) Convert to feet " +
          "\n 4.) Quit the program";
     return menu;         
    }                             
     
                                                             
       public static void processing(int number, double meters)
     {
                          
         switch(number)
         {
             case 1: showKilometers(meters);
             break;
 
             case 2: showInches(meters);
             break;
 
             case 3: showFeet(meters);
             break;
 
             case 4: System.exit(0);
             default:
           
               String input;
    input = JOptionPane.showInputDialog ( "Enter a number from 1-4" );
    number = Int.parseint (input);
         }
    }
                                 
 public static double showKilometers(double meters, double kilometers)
    {
    
      kilometers = meters * 0.001;
      return (kilometers);
      JOptionPane.showMessageDialog (null, "The amount of meters entered was " + meters + " meters." +
                    " This is converted to " + kilometers + " kilometers.");
     
    }
     
    public static double showInches(double meters, double inches)
    {
      inches = meters * 39.37;
    
         JOptionPane.showMessageDialog (null, "The amount of meters entered was " + meters + " meters." +
                    " This is converted to " + inches + " inches.");
     
    }
                                 
   
      public static double showFeet(double meters, double feet)
        {
      feet = meters * 3.281;
     
         JOptionPane.showMessageDialog (null, "The amount of meters entered was " + meters + " meters." +
                    " This is converted to " + feet + " feet.");
     
      }}

Name: Anonymous 2011-10-24 2:09

haha

Name: Anonymous 2011-10-24 2:10

public class Conversion {
    private static boolean OPIsAFaggot = true;

    public static void main(String[] args) {
        if(OPIsAFaggot) {
            System.out.println("Go back to /g/");
        }
    }
}

Name: Anonymous 2011-10-24 2:25

>>3
You mean if(OP.IsFaggot())

Name: Anonymous 2011-10-24 2:35

Is that the fabled ``chaos indentation''?

Name: Anonymous 2011-10-24 5:36

>function definition in a function definition
>returns a String where an int is expected
what the fuck is this

Name: Anonymous 2011-10-24 5:44

>>3
    public class Conversion {
        public static boolean OPIsAFaggot = true;

        public static void main(String[] args) {
            if(Conversion.OPIsAFaggot) {
                System.out.println("Go back to /g/");
            }
        }
    }

Name: Anonymous 2011-10-24 5:54

This is really bad, will take a while.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List