Football simulator help!!!!!!

luettke10's Avatar, Join Date: Mar 2010
Go4Expert Member
I need someone to make a football simulator for me. It needs to be a college football simulator where the user inputs two teams and then the program outputs a winner to the user. It would be a very simple program and the simulation would be based off the ranks of the teams. Thank you for the help.
luettke10's Avatar, Join Date: Mar 2010
Go4Expert Member
I also need to know how to use decimals in Java Programming
luettke10's Avatar, Join Date: Mar 2010
Go4Expert Member
This is what I have so far:
Code:
import java.io.* ;

class Tut2 {
     public static void main(String args[])
    
     {
          InputStreamReader istream = new InputStreamReader(System.in) ;
          BufferedReader bufRead = new BufferedReader(istream) ;

          System.out.println("Welcome To My First Java Program");

          try {
               System.out.println("Please Enter Higher Ranked Team ");
               String firstName = bufRead.readLine();

               System.out.println("Please Enter Lower Ranked Team ");
               String bornYear = bufRead.readLine();

               System.out.println("Please Enter Rank of Higher Ranked Team ");
               String higher = bufRead.readLine();
               
               System.out.println("Please Enter Rank of Lower Ranked Team ");
               String lower = bufRead.readLine();

               int low = Integer.parseInt(lower);
               int high = Integer.parseInt(higher);
               float num1 = .84f;

               int x = low - high;
               
               float t = x * num1;
               
               float m = 100f - t;
               
            System.out.println("Percentage "+ firstName +" wins is " + t + "%");
            System.out.println("Percentage "+ bornYear +" wins is " + m + "%");
          }
          catch (IOException err) {
               System.out.println("Error reading line");
          }
          catch(NumberFormatException err) {
               System.out.println("Error Converting Number");
          }   
     }
}
I need it to recognize "m" and "t" as percentages and then based off of the those pick one of them. I know how to show the winner I just need to know how to get the program to pick the winner or if it is possible to do this.

Last edited by shabbir; 8May2010 at 10:21.. Reason: Code blocks