astros vs. rangers- can someone help me with this?
Predictions.java
You are writing a prediction software program to see if the Houston Astros are going to win their game against the Texas Rangers. They will play nine innings. You need to simulate those innings. The Rangers are the away team and will bat first. Print out the ever innings results and the resulting score of the game.
How do I do that? Well, there are many cool ways to write a simulation program, but let’s do a basic simulation:
Every time a team plays their inning they have a 50% chance of scoring, if they do score, then randomize a run score between 1 and 6. If they don’t score, then give them a zero. Do this for each team in all nine innings. If the home team is winning in the bottom of the 9th inning, then they don’t have to play.
Play Ball!
Code :
import java.util.Random;
public class Predictions
{
public static void main(String[]args)
{
int innings=9;
int totalast=(9*innings);
int totalran= (9*innings);
Predictions astros=new Predictions();
Predictions rangers=new Predictions();
astros.getRunCount();
rangers.getRunCount();
Random astros= new Random();
Random rangers=new Random();
int min=0;
int max=6;
for(int i=0;astros>=1;rangers>=1;i++)
{
System.out.println (astros: + :rangers);
}
}
}
Thanks guys. --Ian--