astros vs. rangers- can someone help me with this?
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.
Thanks guys. --Ian--
public class Predictions
public static void main(Stringargs)
int totalran= (9*innings);
Predictions astros=new Predictions();
Predictions rangers=new Predictions();
Random astros= new Random();
Random rangers=new Random();
System.out.println (astros: + :rangers);