

import java.util.Random;
import java.util.Scanner;
public class HelloWorld{
public static void main(String []args){
int human, computer,dice1,dice2,c=0,h=0;
String name;
Random r = new Random();
Scanner sc=new Scanner(System.in);
dice1=r.nextInt(50);
dice2=r.nextInt(50);
System.out.println("Your name: ");
name=sc.next();
System.out.println("Welcome "+name+" to the game of Taking
Stone");
if(dice1>dice2)
{
System.out.println("Dice is won by human");
System.out.println("Provided number of stones: ");
human=sc.nextInt();
computer=r.nextInt((50 - 10) + 1) + 10;
System.out.println("Number of stones provided by computer:
"+computer);
while(h!=3 || c!=3)
{
while(true)
{
System.out.println("Choose number (1-3) to remove first set of
number from piles: ");
int num1=sc.nextInt();
if(num1>3 || num1<0)
{
System.out.println("Number is invalid");
System.out.println("please choose number between 1 to 3!!!");
}
else
{
h++;
break;
}
}
int num2=r.nextInt((3 - 1) + 1) + 3;
c++;
}
}
else
{
System.out.println("Dice is won by computer");
computer=r.nextInt((50 - 10) + 1) + 10;
System.out.println("Number of stones provided by computer:
"+computer);
System.out.println("Provided number of stones: ");
human=sc.nextInt();
while(h!=3 || c!=3)
{
int num2=r.nextInt((3 - 1) + 1) + 3;
c++;
while(true)
{
System.out.println("Choose number (1-3) to remove first set of
number from piles: ");
int num1=sc.nextInt();
if(num1>3 || num1<0)
{
System.out.println("Number is invalid");
System.out.println("please choose number between 1 to 3!!!");
}
else
{
h++;
break;
}
}
}
}
if(h>c)
System.out.println("Congrats!!!! Human won");
else System.out.println("Congrats!!!! Computer won");
}
}

Please help with Java Programming project! Project outcomes: Develop a Java program that: .reads input from...
Programming Project #5 Project Outcomes: Develop a Java program that Uses selection constructs (if, and if else). Uses the Java iteration constructs (while, do, for). Uses static variables. Ensure integer variables input are within a range that will not cause integer overflow. Uses proper design techniques including reading UML Class Diagrams Background Information: The Unified Modeling Language (UML) provides a useful notation for designing and developing object-oriented software systems. One of the basic components of the UML is a class...
Using very basic Java programming Write a program that lets the user play the game of Rock, Paper, Scissors against the computer.The program should use an array of Strings with the names of the choices.The program should loop until the human player decides to quit.The game should keep track of how many times the human won, lost, or tied and present those values when the game ends.
I need to create a Tic Tac Toe program in C++. These are the requirements Write a program that allows the computer to play TicTacToe against a human player or allow two human players to play one another. Implement the following conditions: The player that wins the current game goes first in the next round, and their symbol is X. The other player will be O. Keep track of the number of games played, wins, and draws for each player....
You will write a two-class Java program that implements the Game of 21. This is a fairly simple game where a player plays against a “dealer”. The player will receive two and optionally three numbers. Each number is randomly generated in the range 1 to 11 inclusive (in notation: [1,11]). The player’s score is the sum of these numbers. The dealer will receive two random numbers, also in [1,11]. The player wins if its score is greater than the dealer’s...
Need Help with homework problem writing the game of nim in Python IDLE. Its a well known game with a number of variants. The following variant has an interesting winning strategy. Two players alternately take marbles from a pile. In each move, a player chooses how many marbles to take. The player must take at least one but at most half of the marbles. Then the other player takes a turn. The player who takes the last marble loses. Instructions...
For your final project you will incorporate all your knowledge of Java that you learned in this class by programming the game of PIG. The game of Pig is a very simple jeopardy dice game in which two players race to reach 100 points. Each turn, a player repeatedly rolls a die until either a 1 is rolled or the player holds and scores the sum of the rolls (i.e. the turn total). At any time during a player's turn,...
Programming Project 3 See Dropbox for due date Project Outcomes: Develop a Java program that uses: Exception handling File Processing(text) Regular Expressions Prep Readings: Absolute Java, chapters 1 - 9 and Regular Expression in Java Project Overview: Create a Java program that allows a user to pick a cell phone and cell phone package and shows the cost. Inthis program the design is left up to the programmer however good object oriented design is required. Project Requirements Develop a text...
Java CSC252 Programming II Static Methods, Enums, Constants, Random Rock Paper Scissors Write a program that allows the user to play "Rock, Paper, Scissors". Write the RPS class. All code should be in one file. main() will be part of the RPS class, fairly small, and contain only a loop that asks the user if they want to play "Rock, Paper, Scissors". If they say yes, it calls the static method play() of the RPS class. If not, the program...
In this programming project you are required to develop a 16-bit CRC program using Java and test your program with the crctest.txt file. The corresponding 16-bit CRC should be attached to the end of each line. You are asked to use a 16-bit polynomial - x^16+x^12+x^5+1. You are allowed to use the Java 16-bit CRC library - java.io* & java.util.zip.CRC, but your max points will be 20/25. The contents inside the crctest.txt file include: Computer Science! Fall Foliage around Poconos...