Preskoči na glavni sadržaj
Prijava
Sign up for FREE
arrow_back
Biblioteka

Classes Part 1 Test Review

star
star
star
star
star
Posljednje ažuriranje about 2 years ago
21
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
Pitanje 1
1.

What is output by the code below?

System.out.println( Math.floor(6.7) );

Pitanje 2
2.

What is output by the code below?

System.out.println( Math.sqrt(144) );

Pitanje 3
3.

What is output by the code below?

System.out.println( (int)Math.pow( Math.sqrt(40),2) );

Pitanje 4
4.

What is output by the code below?

System.out.println( Math.ceil(7.23) );

Pitanje 5
5.

How many methods does Bird contain?

public class Bird

{

public void speak()

{

out.println("chirp-chirp");

}

public void sayName()

{

out.println("baby bird");

}

}

Pitanje 6
6.

What is output by the code below?

public class Fun

{

public int times(int num1, int num2)

{

return num1 * num2;

}

}

Fun aplus = new Fun();

System.out.println( aplus.times( 7, 3 ) );

Pitanje 7
7.

What is output by the code below?

public class Test

{

public void go()

{

out.print("A");

}

public void fun()

{

out.print("B");

go();

}

}

Test x = new Test();

x.fun();

Pitanje 8
8.

What is output by the code below?

public class Fun2

{

public static int times(int num1, int num2)

{

return num1 * num2;

}

}

System.out.println( Fun2.times(3 , 5) );

Pitanje 9
9.

What is output by the code below?

System.out.println( Math.min(16,18) );

Pitanje 10
10.

What is output by the code below?

public class Fun2

{

public static int times(int num1, int num2)

{

return num1 + num2;

}

}

System.out.println( Fun2.times(5 , 5) );

Pitanje 11
11.

What is output by the code below?

System.out.println( Math.max(16,18) );

Pitanje 12
12.

What is output by the code below?

public class Fun

{

public int times(int num1, int num2)

{

return num1 + num2;

}

}

Fun aplus = new Fun();

System.out.println( aplus.times( 7, 3 ) );

Pitanje 13
13.

What is output by the code below?

System.out.println( Math.pow(6,2) );

Pitanje 14
14.

What is output by the code below?

public class Test

{

public void go()

{

out.print("A");

}

public void fun()

{

out.print("B");

}

}

Test x = new Test();

x.go();

x.fun();

Pitanje 15
15.

What is output by the code below?

System.out.println( Math.floor(9.567) );

Pitanje 16
16.

What is output by the code below?

public class Test

{

public void go()

{

out.print("A");

}

public void fun()

{

out.print("B");

}

}

Test x = new Test();

x.fun();

x.go();

Pitanje 17
17.

What is output by the code below?

public class Test

{

public void go()

{

out.print("A");

}

public void fun()

{

out.print("B");

}

}

Test x = new Test();

x.go();

x.go();

Pitanje 18
18.

What is output by the code below?

System.out.println( Math.pow( Math.sqrt(16),2) );

Pitanje 19
19.

How many return methods does Bird contain?

public class Bird

{

public void speak()

{

out.println("chirp-chirp");

}

public void sayName()

{

out.println("baby bird");

}

}

Pitanje 20
20.

What is output by the code below?

public class Test

{

public void go()

{

out.print("A");

}

public void fun()

{

out.print("B");

}

}

Test x = new Test();

x.go();

Pitanje 21
21.

Methods Free Response

Directions :: Fill in the show your work box with your answer with the appropriate Java code.

Directions :: Write only one method named printABox. printABox will print out the box shown below which contains 5 rows of the capital letter A. In the most efficient way possible.

AAAAAAA

AAAAAAA

A A

AAAAAAA