Choosing how to earn college credit? CLEP vs AP guide
| preferred AP College board partner for AP classes
hard

Geometric Calculation

Mark
< Prev
Next >

The program calculates the magnitude of a displacement vector in two dimensions.

What is printed when the following Java program is compiled and run?

public class QuestionTrace {

    public static void main(String[] args) {
        double dx = -3.0;
        double dy = 4.0;
        double val = Math.sqrt(Math.pow(Math.abs(dx), 2) + Math.pow(Math.abs(dy), 2));
        System.out.print((int) val);
    }
}
A

5

B

7

C

25

D

12

Did You Know?
Explain Why
Explain All Answers
Check Answer
Show Correct Answer
Report Question

Question Leaderboard

Not enough data yet to show leaderboard.

No comments yet. Be the first to comment!

AI Tutor

How can I help?

APFIVE © 2020.
Email: apfive@apfive.org|Instagram: @_apfive_|Privacy Policy|