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.