Course Solutions Uncategorized (Solved) : Import Javautilarraylist Import Javautilrandom Import Javautilscanner Public Class Jeopard Q26340316 . . . .

(Solved) : Import Javautilarraylist Import Javautilrandom Import Javautilscanner Public Class Jeopard Q26340316 . . . .

 

import java.util.ArrayList;
import java.util.Random;
import java.util.Scanner;
public class JeopardyGame
{
public static void main(String args[])
{
Scanner input_letter = new Scanner(System.in);
ArrayList possiblevalues= new ArrayList() {{add(‘r’);add(‘h’);}};
int playerzdice=0;
int computerzdice=0;
int player_points=0;
int computer_points=0;
int max_points_in_a_turn_computer = 0; // maximum points thecomputer can get per turn.
boolean playerz_turn = true;//check if player’s turn.
while(player_points<100 || computer_points <100)
{
if(playerz_turn)
{
while(true)
{
System.out.println(“Gamer 1, you have “+player_points + ” pointsnow..in total. Plz enter”+possiblevalues+” where r to Roll, h tohold dice”);
char action = input_letter.next().charAt(0);
if(action == ‘r’)
{
playerzdice = rollDice();
System.out.println(“Gamer 1 you got ” + playerzdice);
if(playerzdice == 1)
{
System.out.println(“Gamer 1..Your Turn Over”);
playerzdice = 0;
player_points = 0;
playerz_turn =! playerz_turn;
break;
}
else
{
player_points=+playerzdice;
System.out.println(“Gamer 1 your total is ” +player_points);
}
}
else if(action == ‘h’) // if to hold
{
System.out.println(“Gamer 1’s current score is”+player_points);
playerz_turn

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

(Solved) : Hello Beginning Computer Science Class Need Help Completing Problem Problem Include Using Q37103546 . . . .(Solved) : Hello Beginning Computer Science Class Need Help Completing Problem Problem Include Using Q37103546 . . . .

<p><img alt="Hello, I am in a beginning computer science class and need help completing this problem. Here is the problem:" src="https://media.cheggcdn.com/media%2Fc2b%2Fc2b913b5-59c2-47c3-be80-d4549b414625%2Fphp5n87wy.png" aria-describedby="d3f"/><img alt="#include<iostream> using namespace std; const int COL =