Animation Flashcards

1
Q

What is the purpose of the Planet class in the animation example?

a) To create a window for displaying GUI components
b) To represent a planet with properties like position, color, and orbit
c) To manage database connections
d) To handle HTTP requests

A

b) To represent a planet with properties like position

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the purpose of the computeNewXY method in the Planet class?

a) To create a new window
b) To compute the new X and Y coordinates of the planet based on its orbit
c) To manage database connections
d) To handle HTTP requests

A

b) To compute the new X and Y coordinates of the planet based on its orbit

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the purpose of the update method in the Planet class?

a) To create a new window
b) To update the planet’s position along its orbit
c) To manage database connections
d) To handle HTTP requests

A

b) To update the planet’s position along its orbit

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the purpose of the getRadius method in the Planet class?

a) To create a new window
b) To compute the radius of the planet based on its diameter
c) To manage database connections
d) To handle HTTP requests

A

b) To compute the radius of the planet based on its diameter

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the purpose of the SolarSystem class in the animation example?

a) To create a window for displaying GUI components
b) To manage the animation of planets orbiting the Sun
c) To manage database connections
d) To handle HTTP requests

A

b) To manage the animation of planets orbiting the Sun

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the purpose of the Runnable interface in the SolarSystem class?

a) To create a new window
b) To enable the class to run as a thread for animation
c) To manage database connections
d) To handle HTTP requests

A

b) To enable the class to run as a thread for animation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the purpose of the run method in the SolarSystem class?

a) To create a new window
b) To continuously update and repaint the animation
c) To manage database connections
d) To handle HTTP requests

A

b) To continuously update and repaint the animation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the purpose of the update method in the SolarSystem class?

a) To create a new window
b) To update the positions of all planets in the animation
c) To manage database connections
d) To handle HTTP requests

A

b) To update the positions of all planets in the animation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the purpose of the paintComponent method in the SolarSystem class?

a) To create a new window
b) To draw the Sun and planets on the panel
c) To manage database connections
d) To handle HTTP requests

A

b) To draw the Sun and planets on the panel

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the purpose of the start method in the SolarSystem class?

a) To create a new window
b) To start the animation thread
c) To manage database connections
d) To handle HTTP requests

A

b) To start the animation thread

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the purpose of the DrawPlanets class in the animation example?

a) To create a window for displaying GUI components
b) To set up the frame and start the animation
c) To manage database connections
d) To handle HTTP requests

A

b) To set up the frame and start the animation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the purpose of the JFrame class in the DrawPlanets class?

a) To create a window for displaying the animation
b) To manage the animation of planets orbiting the Sun
c) To manage database connections
d) To handle HTTP requests

A

a) To create a window for displaying the animation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the purpose of the pack method in the DrawPlanets class?

a) To create a new window
b) To resize the frame to fit its contents
c) To manage database connections
d) To handle HTTP requests

A

b) To resize the frame to fit its contents

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the purpose of the setVisible method in the DrawPlanets class?

a) To create a new window
b) To make the frame visible
c) To manage database connections
d) To handle HTTP requests

A

b) To make the frame visible

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the purpose of the Thread.sleep method in the run method of the SolarSystem class?

a) To create a new window
b) To pause the animation for a short time to control the frame rate
c) To manage database connections
d) To handle HTTP requests

A

b) To pause the animation for a short time to control the frame rate

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the purpose of the Graphics2D class in the paintComponent method of the SolarSystem class?

a) To create a new window
b) To provide advanced drawing capabilities for the animation
c) To manage database connections
d) To handle HTTP requests

A

b) To provide advanced drawing capabilities for the animation

17
Q

What is the purpose of the fillOval method in the paintComponent method of the SolarSystem class?

a) To create a new window
b) To draw filled circles representing the Sun and planets
c) To manage database connections
d) To handle HTTP requests

A

b) To draw filled circles representing the Sun and planets

18
Q

What is the purpose of the List<Planet> property in the SolarSystem class?</Planet>

a) To create a new window
b) To store and manage the list of planets in the animation
c) To manage database connections
d) To handle HTTP requests

A

b) To store and manage the list of planets in the animation

19
Q

What is the purpose of the Thread.ofVirtual() method in the SolarSystem class?

a) To create a new window
b) To create a virtual thread for running the animation
c) To manage database connections
d) To handle HTTP requests

A

b) To create a virtual thread for running the animation