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 java code i need help with this. we are

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

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!