Java Function Quiz! (in Off-topic)


RedWolf September 20 2007 3:24 PM EDT

The output is...? For those of you who don't know Java, all you need is under public functionquiz().
import java.util.*;
public class functionquiz
{
    public functionquiz(){
        int a;
        int b;
        int c;
        
        a = 7;
        b = 4;
        c = 5;
        a+= -4;
        a = b + c;
        b = b * 3;
        c = b % a;
        a = (int)Math.pow(2,c);
        b = (int)Math.min(Math.max(b+2,c%a%1),Math.sqrt(a+1));
        c = a+b * (b+2 / b-2) -1;
        a = (int)Math.ceil(b/(c/2));
        
        System.out.println(a + " " + c + " " + b);
    }

    public static void main(String[] args){
        new functionquiz();
    }
}

drudge September 20 2007 3:41 PM EDT

u just had to use math, didn't you....geezus!

Cube September 20 2007 4:26 PM EDT

This is what I Got
0 3 22

Cube September 20 2007 4:30 PM EDT

i mean
0 22 3

PoisoN September 20 2007 4:31 PM EDT

0 10 3

SNK3R September 20 2007 4:43 PM EDT

I'm with PoisoN: 0 10 3

Cube September 21 2007 5:39 PM EDT

Oops, found my mistake. You're both right.

RedWolf September 21 2007 10:51 PM EDT

Yes, 0 10 3 is the correct output. That last line was the one that got most of my class. I don't think anybody got that last line right.
This thread is closed to new posts. However, you are welcome to reference it from a new thread; link this with the html <a href="/bboard/q-and-a-fetch-msg.tcl?msg_id=002Duy">Java Function Quiz!</a>