All pastes #799543 Raw Edit

Mine

public text v1 · immutable
#799543 ·published 2007-11-27 18:38 UTC
rendered paste body
import java.util.*;


class convertdecimal
{


    public static void main(String[] args)
    {
       
        Scanner scan1 = new Scanner(System.in);
        Scanner scan2 = new Scanner(System.in);
        Scanner binaryscan = new Scanner(System.in);
        Scanner decimalscan = new Scanner(System.in);

        int input_result = 0;
        string binaryinput; //holds users binary number
        int decimalinput; //holds users decimal input
 System.out.println(input_result);
        System.out.println(
            "Hello; /n Would you like to convert a Binary Number to a Decimal Number? (Y/N)");
        string ynBinary = scan1.next();
        if (ynBinary = Y | y)
        {
            input_result = 1;
            System.out.println("Ok, please input your Binary String.");
            binaryinput = binaryscan.next();
        }
        else if (ynBinary = N | n)
        {
            System.out.println(
                "Would you like to convert a Deciamal Number to a Binary Number? (Y/N)");
            String ynDecimal = scan2.next();
    //    }
/////////////////////////////////////BEGIN INTERNAL IF STRUCTURE
        if (ynDecimal = Y | y)
        {
            input_result = 2;
            System.out.println("Ok, please input your Binary String.");
            decimalinput = decimalscan.nextInt();
        }
        else if (ynDecimal = N | n)
        {

            System.out.println(
                "Sorry, but looks like this program is not for you!");
        }
        else
        {
            System.out.println("Your input is invalid!");
        }
        }
/////////////////////////////////////END INTERNAL IF STRUCTURE
        else
        {
            System.out.println("Your input is invalid!");
        }



        //   	System.out.println(input_result);

    }
}