Stack Exchange
Calculating circumference of circle using method
It may be rather simple but I am having issues returning a value for "circum" here is my code.
double circRad = 0;
double circum = 0;

if(userOption == 2){

        circRad = myRad();
        System.out.println("The Radius of the circle is " + circRad + " and it perimeter is "+ circum);

public static double myRad(){

    int i= 1;
    double circRad = 0;
    Scanner myInput=new Scanner(System.in);

    switch(i)
    {
        case 1:
        System.out.print("Please enter a positive Radius for the circle ");
        circRad = myInput.nextDouble();
        while(circRad <0){
            System.out.print("Please enter a POSITIVE Radius for the circle ");
            circRad = myInput.nextDouble();
            }
                ++i;
    }
    return circRad;
}

public static double myRad(double circRad){

    double circum = 0;

    circum = 2* Math.PI * circRad;

    return circum;
}


So what exactly is the problem?

You initialized circum as 0 but did not put the value of circRad comes from myRad(). Add this before you output the radius and perimeter:
"circum = myRad(circRad);"

Perhaps you are missing the following:
if(userOption == 2){
    circRad = myRad();
    circum  = myRad(circRad); // <-- missing setting local circum value
    System.out.println("The Radius of the circle is " + circRad + " and it perimeter is "+ circum);
}


Only thing I could guess about the code with the way it is presented is that circRad and circum are global variables, therefore when you call the first myRad() only circRad changes. However, circum remains 0.
If you could sent the entire code, it'll make everything easier.
