Programming Assignment Quiz | Object Oriented Programming in Java


Object Oriented Programming in Java

Memory Models, Scope, and Starting the Project

Question 1

Consider the following line of code:

map1 = new UnfoldingMap(this5050350500
                        new Google.GoogleMapProvider());
Question 1

Consider the following line of code:

What is the y-coordinate which corresponds to the pixel at the lower left corner of the map that is created by the line of code above?

Remember that the axis (0,0) for pixels is in the upper left corner of the screen and higher y values appear lower on the screen. (This is unlike Cartesian coordinates where higher y values appear higher than the axis (0,0).)

1 / 1 point

550 is the y coordinate of the lower left corner of the map, since positive y points down.

Question 2

Which of the following lines of code will create two maps of the same height next to each other, side-by-side in the window.

map1 = new UnfoldingMap(5050200300);
map2 = new UnfoldingMap(25050200300);

map2's upper left coordinate is (250, 50), while map1's upper left coordinate is (50, 50). So map2 will be to the right of map1, but at the same height.

Question 3

Assume you have some code that creates two maps that are supposed to be displayed side by side in an Applet window. Your code compiles and runs, but only one map shows up in the visible portion of the Applet window when you run it. Which of the following bugs might explain why? SELECT ALL the possible mistakes that could be causing this problem.

Forgetting to call map2.draw()

Placing the map2 outside the coordinates of the window

Question 4

Which of the following latitude, longitude pairs, when passed to the method zoomAndPanTo, would cause the map to be centered on Rio de Janeiro, Brazil?

-22.9, -43.2


Post a Comment