Terrible, terrible code, I have no understanding of OOPs, please destroy/debug, I can't determine my head from my a$$ metaphorically

public class converter
{
    public static void main(String[] args)
    {
            System.out.println("Welcome the metric/imperial converter");

            boolean loop = true;
            while(loop == true){

            char Decider = Input.getChar("Convert to Imperial or Metric (I/M)");

            if(Decider == 'I' || Decider == 'i'){
                    if(WeightOrLength() == true)
                            weight2Imperial(Input.getDouble("Put in the amount of kilos (0 if none)"), Input.getDouble("Put in the amount of grams (0 if none)"));
                    else
                            length2Imperial(Input.getDouble("Put in the amount of kilometers (0 if none)"), Input.getDouble("Put in the amount of meters (0 if none)"));



                    loop = false;
            } else if(Decider == 'M' || Decider == 'm'){
                            if(WeightOrLength() == true) {
                                    weight2metric(Input.getDouble("Put in the number of pounds (0 if none)"), Input.getDouble("Put in the number of ounces"));
                            }
                            else{
                                    length2metric(Input.getDouble("Put in the number of miles (0 if none)"), Input.getDouble("Put in the number of feet (0 if none)"));




                                    loop = false;
            } else {
                    continue;
            }
    }

    public static void weight2Imperial(double Kilo, double Gram){


            OverConverter(Kilo, 2.2046F, Gram, 0.03527F, 16F, kilograms, grams, pounds, "percentage of the pound");

    }

    public static void length2Imperial(double Km, double Me){


            OverConverter(Km, 0.6214F, Me, 3.2808F, 5280F, "kilometers", "meters", "miles", "feet");

    }

    //OverConverter(double a, double c, double b, double c1, double y, String GreaterOg, String LowerOg, String GreaterCon. String LowerCon)

    public static void weight2metric(double Lbs, double Oz){


            OverConverter(Lbs, .4536F, Oz, 0.00285F, 1000F, "pounds", "ounce", "kilogram", "Percentage of kilogram (gram)");


    }

    public static void length2metric(double Miles, double Feet){
            OverConverter(Miles, 1.61F, Feet, .0003048F, 1000F, "miles", "feet", "kilometers", "meters")

    }

    public static boolean WeightOrLength(){

            Boolean Satin = true;
            Boolean loopin = true;
            char Decider = Input.getChar("Weight or Height (W/H)");

            while (loopin == true) {

                    if (Decider == W || Decider == w) {
                            Satin = true;
                            Loopin = false;
                    } else {
                            if (Decider == H || Decider == h) {
                                    Satin = false;
                                    Looping = false;
                            } else {
                                    continue;
                            }
                    }
                    return Satin;
            }
    }



    public static void OverConverter(double a, double c, double b, double c1, double y, String GreaterOg, String LowerOg, String GreaterCon. String LowerCon)
    {


    double x = a * c;

    double r = b * c1;

    double z = x % y;

    double q = (x - z)/y;

    double m = z + r;

    if(m > z){
            //redoing the orginal computation on the smaller value which has the potential to become larger than the larger denomination
            double n = z % y;
            double l = (z - n)/y;

            q += l;
            z += n;
    }

    double p = m/y + q;

    System.out.println( a + " " +  GreaterOg  + " & " + b + " " + LowerOg + " in " + GreaterCon +" and " + LowerCon + " is " + q + " " + GreaterCon + " and " + z + " (Or just " + p);
    }

}

So it’s pretty bad, I think that the title explains it, teacher isn’t really explaining objects that well, I just really need someone to rip it to shreds. I kinda understand why it puts out 47 errors in the compiler. Much alike my last post like this the answer is probably infront of me so being abrasive helps.

General advice, regardless if it is OOP language or any other kind:

  • Use code formatting feature of your editor. Running code formatting would show any not properly closed body or statement. Compilers usually gets crazy when such case happens and starts pointing errors in wrong places. And formatting usually will show by changing indentation of lines that for example by missing ) or } half of the file is not readable for the compiles.
  • Do not use editor that do not support code-formatting - mainly because of the above “side effect” of it.

If you implement above advice you will see obvious mistakes right away (if editor have code formatting it will also have error highlighting for the same language).

After that you will need to solve last few things (not going into the actual problem you are trying )

  • “Input” class.
  • You have also most irritating typo there can be in code: dot instead of comma (and vice versa) .
  • The code you wrote is completely in opposition to OOP paradigms.

working on it

alright, so I did some code to help you out. Still working on it, because its been a bout a year since I did anything in java.

If you read my comments in the source code it should help you out.

Wrong forum. There are nearly no programmers in here.

@Grim_Reaper luckily I’m one of them :wink:

Btw @omega_alpha_psi I updated the project some more.

To-do’s

Link the package correctly because it cannot find symbols. I am having difficulties linking across multiple files; working on it. Just a bit slower because I’m not using a java IDE.

The API class still needs an implementation under the main loop within the switch case for using the methods of the Weight and Length class.

Hopefully, this has helped you some more.