Menu

(Solved) : 4 10 Pts Program Name Headtailgeneratorjava Perform Shown Sequence Inputs Outputs User Fir Q44106299 . . .

4. (10 pts) Program name: HeadTailGenerator.java which can perform the shown sequence of inputs and outputs. Here, the user f

4. (10 pts) Program name: HeadTailGenerator.java which can perform the shown sequence of inputs and outputs. Here, the user firstly inputs the number of times the user would like to play the game and then in each game the user can enter string with heads (H) or tails (T) separated by spaces. Consider the coin flips entered for a game and output the number and percentage of heads in that game. If it is more than 50%, print “You win!!” along with the head scores or “You lose :(” along with the head scores: Below shows sample sequence of steps consisting inputs and outputs: Number of times to play the Enter the coin flips for game 1: H T H H T Enter the coin flips for game 2: Tt t Th H gате: Below are the scores: Game 1: 3 heads (60.0%); You win!! 2 heads (33.3%); You lose 🙁 Game 2: Show transcribed image text 4. (10 pts) Program name: HeadTailGenerator.java which can perform the shown sequence of inputs and outputs. Here, the user firstly inputs the number of times the user would like to play the game and then in each game the user can enter string with heads (H) or tails (T) separated by spaces. Consider the coin flips entered for a game and output the number and percentage of heads in that game. If it is more than 50%, print “You win!!” along with the head scores or “You lose :(” along with the head scores: Below shows sample sequence of steps consisting inputs and outputs: Number of times to play the Enter the coin flips for game 1: H T H H T Enter the coin flips for game 2: Tt t Th H gате: Below are the scores: Game 1: 3 heads (60.0%); You win!! 2 heads (33.3%); You lose 🙁 Game 2:

Expert Answer


Answer to 4. (10 pts) Program name: HeadTailGenerator.java which can perform the shown sequence of inputs and outputs. Here, the u…

OR