Question: I need java code i need help with this. we are suppose to use random function. this is what i have so far import java.util.Scanner;
I need java code

i need help with this. we are suppose to use random function. this is what i have so far
import java.util.Scanner; import java.util.Random; public class homework2three { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String coin = System.out.println("Do you want heads to win or tails to win"); String userInput = scanner.next(); } } Exercise 3 of 3: Write a program that lets the user play a simple coin flip game against the computer First let the player set the rule for the game (e.g. Heads wins, or Tails wins). Then generate a random outcome of a coin flip for yourself, and one for the computer. Determine the winner. Ask the user if they want to play again, and keep score. Once the user is done playing and decides to quit, present the final score before ending the game
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
