Question: 1. Write a javaFX program that implements that implements a circle. Take two buttons named play and pause. Create a mouse click event in such

 1. Write a javaFX program that implements that implements a circle.

1. Write a javaFX program that implements that implements a circle. Take two buttons named play and pause. Create a mouse click event in such a manner that, if play button is clicked, the respective circle will change it's colour to green and move 30 degrees toward right. The animation stops only if the pause button is clicked. 2. Create an Abstract Class named Restaurant. Create a function/method that will print the name of the restaurant when called. Create an abstract function/method named total price, Create an abstract function/method named menu items, Create an abstract function/method name location Create a Class called McDonalds that extends Restaurant Implement all abstract methods Add logic so that the total price method/function will give the total price of the meal including a 6% tax. Add a method that returns a Boolean named has Play Place, which returns true when this location has a play place. Create a Constructor that will set the name of the Mcdonalds, location, and has Play Place. 3. Write a program to solve producer and consumer problem in java. Hints: This is a classical synchronization problem that involves a fixed size buffer or queue which can have items or task added to it or removed from it by different producer and consumer threads. The key is to solve the problem in such a way that the producer should wait if the queue is full and the consumer should wait if the queue is empty which involves inter-thread communication. Output: Both Producer and Consumer thread can run in any order, even though you have started it doesn't mean that producer will produce first and then the consumer will consume. Whenever the producer gets a chance, it keeps producing until the queue is full, the same goes with the consumer. You can see that the Consumer is waiting when the queue is empty and the Producer is waiting when the queue is full which is the expected behaviour. Any change to the shared object, is happening inside the synchronized block so that changes made by one thread are visible to the other. Remember whenever a thread exit or enter a synchronized block, memory barrier is refreshed

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!