• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Need a bit of help on JAVA

Xylitol

Diamond Member
public double south(double num3, double num4)
{
num3 += 24;
num4 *= 2;
System.out.println("num3 / num4 = " + (num3/num4));
return (10 * (num3 + num4));
}

Thats what it says
I have to find the final output
I know that num3 = num3 + 24 and num4 = num4 * 2

num3/num4 = num3/num4 ????
What good does that do me?

Or am I doing this wrong?
If I am can someone lead me in the right directions

Thanks
 
Are you referring to:

System.out.println("num3 / num4 = " + (num3/num4));

???

If so, that is simply printing the result of num3 divided by num4 with the text "num3 / num4" before it.
 
Originally posted by: binister
Are you referring to:

System.out.println("num3 / num4 = " + (num3/num4));

???

If so, that is simply printing the result of num3 divided by num4 with the text "num3 / num4" before it.

Yea but as my answer, am I just supposed to leave my answer as numx
x = any #?
 
Originally posted by: Xylitol
public double south(double num3, double num4)
{
num3 += 24;
num4 *= 2;
System.out.println("num3 / num4 = " + (num3/num4));
return (10 * (num3 + num4));
}

Thats what it says
I have to find the final output
I know that num3 = num3 + 24 and num4 = num4 * 2

num3/num4 = num3/num4 ????
What good does that do me?

Or am I doing this wrong?
If I am can someone lead me in the right directions

Thanks

Wrong forum

But by itself, it outputs nothing. What does "main" say?
 
uhhh... not sure if I know what exactly you're asking but from the return statement it looks like you're returning something like:

10(num3 + 24 + 2(num4)) or num3 + 2(num4) + 24 (multiplying out and simplifying)

The System.out.println("num3 / num4 = " + (num3/num4)); has no bearing on the return value since it's not reassigned.




 
Back
Top