Data Structures and algorithms exercise for practice and knowledge, Exercises of Data Structures and Algorithms

practice worthy assignment for further experience

Typology: Exercises

2019/2020

Uploaded on 04/06/2020

sara-khaled-4
sara-khaled-4 🇪🇬

1 document

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Arab Academy for Science & Technology and Maritime Transport
College of Computing and Information Technology
Lecturer: Dr. Walid M. Aly
Course: Advanced Programming Applications (CS244)/Object Oriented Programming (CC316)
Sheet 6 :JavaFX Events
1. (Pick four cards) Write a program that lets the user click the Refresh button to display four cards from a
deck of 52 cards, as shown in Figure
Hint: for Shuffling use the static shuffle method in the java.util.Collections class.
2. (Move the ball) Write a program that moves the ball in a pane. You should define a pane class for
displaying the ball and provide the methods for moving the ball left, right, up, and down, as shown in
Figure. Check the boundary to prevent the ball from moving out of sight completely.
3. (Create a simple calculator) Write a program to perform addition, subtraction, multiplication, and
division, as shown in Figure.
4. (Alternate two messages) Write a program to display the text Java is fun and Java is powerful alternately
with a mouse click.
5. (Change color using a mouse) Write a program that displays the color of a circle as black when the
mouse button is pressed and as white when the mouse button is released.
6. (Enter and display a string) Write a program that receives a string from the keyboard and displays it on a
pane. The Enter key signals the end of a string. Whenever a new string is entered, it is displayed on the
pane.
7. (Move a circle using keys) Write a program that moves a circle up, down, left, or right using the arrow
keys.

Partial preview of the text

Download Data Structures and algorithms exercise for practice and knowledge and more Exercises Data Structures and Algorithms in PDF only on Docsity!

Arab Academy for Science & Technology and Maritime Transport College of Computing and Information Technology Lecturer: Dr. Walid M. Aly Course: Advanced Programming Applications (CS244)/Object Oriented Programming (CC316)

Sheet 6 :JavaFX Events

  1. ( Pick four cards ) Write a program that lets the user click the Refresh button to display four cards from a deck of 52 cards, as shown in Figure Hint: for Shuffling use the static shuffle method in the java.util.Collections class.
  2. ( Move the ball ) Write a program that moves the ball in a pane. You should define a pane class for displaying the ball and provide the methods for moving the ball left, right, up, and down, as shown in Figure. Check the boundary to prevent the ball from moving out of sight completely.
  3. ( Create a simple calculator ) Write a program to perform addition, subtraction, multiplication, and division, as shown in Figure.
  4. ( Alternate two messages ) Write a program to display the text Java is fun and Java is powerful alternately with a mouse click.
  5. ( Change color using a mouse ) Write a program that displays the color of a circle as black when the mouse button is pressed and as white when the mouse button is released.
  6. ( Enter and display a string ) Write a program that receives a string from the keyboard and displays it on a pane. The Enter key signals the end of a string. Whenever a new string is entered, it is displayed on the pane.
  7. ( Move a circle using keys ) Write a program that moves a circle up, down, left, or right using the arrow keys.