//[login to view URL] the program below so to display on screen each coin flip. //[login to view URL] two boolean variables with he second variable //to store the outcome of the flip. //[login to view URL] the user fails to enter heads or tails, have the program prompt //user to re-enter until the proper input is made (heads or tails or exit). //use jpb package for program operations (create a //folder called jpb and place the four attached zipped files //inside of it import jpb.*; public class Coinflip2 { public static void main (String[] args) { boolean headsWasSelected = false; // Prompt user to guess heads or tails [login to view URL]("Enter heads or tails: "); String userInput = [login to view URL](); if ([login to view URL]("heads")) headsWasSlected = true; else if (![login to view URL]("tails")) { [login to view URL]("Sorry, you didn't enter heads " + "or tails; please try again."); return; } //Choose a random number double randomNumber = [login to view URL]() ; //Determine whether user guessed correctly if (headsWasSelected && randomNumber < 0.5) [login to view URL](You win!"); else if (!headsWasSelected && randomnumber >= 0.5) [login to view URL]("You win!"); else [login to view URL]("Sorry, you loose."); } }
## Deliverables
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. 2) Installation package that will install the software (in ready-to-run condition) on the platform(s) specified in this bid request. 3) Complete ownership and distribution copyrights to all work purchased.
## Platform
Use Java code to import jpb package.