Computer Networking: A Top-Down Approach (7th Edition)
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
Bartleby Related Questions Icon

Related questions

Question
Key stroke enacted moving of a ball
1.
Start
(a) Write a Java program that uses the Up, ↑, Down ↓, Right → (and possibly Left) arrows of the
keyboard (or keypad) to move a ball. (note the Up arrow is called “Up" with ASCII code 38, Down
arrow is called "Down" with ASCII code 40, Right arrow is called "Right" with ASCII code. You can
also use the 4 keys, commonly used in ODS game programming.
Start
Pond
Figure 1. Initially
Pond
End
End
Start
Pond
Start
Figure 2. After 3 moves up using up arrow
End
Pond
End
Figure 3. 3 moves later with right arrows Figure 4. Finally one at the lower right corner.
(b) Using Java class JFrame to draw a grid of 5 horizontal lines, 5 vertical lines, a blue pond in the middle
occupying 5 squares with a text Pond in the middle, a ball at the lower left corner, and texts called
Start and End. This is shown exactly as in Figure 1 here. Change the color of ball from green to
another color.
expand button
Transcribed Image Text:Key stroke enacted moving of a ball 1. Start (a) Write a Java program that uses the Up, ↑, Down ↓, Right → (and possibly Left) arrows of the keyboard (or keypad) to move a ball. (note the Up arrow is called “Up" with ASCII code 38, Down arrow is called "Down" with ASCII code 40, Right arrow is called "Right" with ASCII code. You can also use the 4 keys, commonly used in ODS game programming. Start Pond Figure 1. Initially Pond End End Start Pond Start Figure 2. After 3 moves up using up arrow End Pond End Figure 3. 3 moves later with right arrows Figure 4. Finally one at the lower right corner. (b) Using Java class JFrame to draw a grid of 5 horizontal lines, 5 vertical lines, a blue pond in the middle occupying 5 squares with a text Pond in the middle, a ball at the lower left corner, and texts called Start and End. This is shown exactly as in Figure 1 here. Change the color of ball from green to another color.
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Similar questions
Recommended textbooks for you
Text book image
Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON
Text book image
Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science
Text book image
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning
Text book image
Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning
Text book image
Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education
Text book image
Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY