Question: Every time you run your program it should display a window displaying with the words Heads or Tails 1) Create a Class called Coin Declare

 Every time you run your program it should display a windowdisplaying with the words Heads or Tails 1) Create a Class called

Every time you run your program it should display a window displaying with the words Heads or Tails 1) Create a Class called Coin Declare Class Instance Data. See UML on the next page for the instance variables (shown in bold and italics below) Constructor Method a. b. Set value to a random integer between 0 and 1 ii. If value 1, set sideUp equal to "Heads", else set sidelp equal to "Tails i. c. flipCoin Method i. Set value to a random integer between 0 and 1 ii. If value 1, set sideUp equal to "Heads", else set sidelp equal to "Tails i. return the value for sideUp i. Create as described in class d. getFace method e. toString method 2) main code a. Create an object from Circle Class b. Create an object from the Text class with the word "Heads c. Create an object from the Text class with the word Tails" d. Create an object from Group class e. Create an object from Coin class. f. Call the flipCoin method g. Output the result the toString method to the console CSI 2300-WINTER 2019- HWK 2 h. Call getFace) method. If it returns "Heads" then build a group with the Circle object and the Text object with Heads on it so that the text shows inside the circle object i. Else if getFace0method returns "Tails" then build a group with the Circle object and the Text object with Tails on it so that the text shows inside the circle object j. Add the Group to the Scene k. Add the Scene to the primaryStage . Display the primaryStage -Coin myPenny o yoid start Stage primaryStage) Caino String getf ace String tostringo Figure 1 UML for Homework 2 Homework Tals Figure 2 Example Screen for the Tails State Figure 3Example Screen for the Heads State Problem Points 50 50 For all problems-points will be awarded if all instructions are followed and the code runs without errors. Coin Class Client (main) Code Add comments to the code to explain the tasks. Your window should look different than other students. Two students turning in the exact same window face the possibility of being turned in for cheating

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!