import java.text.DecimalFormat;
import java.util.Locale;
import java.util.Scanner;
import java.text.*;
import java.io.*;
class CoinToes
{
static BufferedReader keyboard = new BufferedReader(new InputStreamReader(System.in));
public static void main(String args[]) throws IOException
{
float numheads = 0;
float numtails = 0;
float numcointosses = 0;
float correct = 0;
float incorrect = 0;
int toss, coinguess, randomguess;
string answer = "y";
string answer;
Decimalformat pf2 = new Decimalformat ("###.0##");
Scanner input = new Scanner(System.in);
while(answer.equalsIgnoreCase("y"))
{
toss = (int)(2*Math.random())+1;
System.out.println("Will the coin toss come up Heads or Tails ? (\"H \"for heads and \"T for tails): ");
guess = input.nextline();
guess = guess.tolowerCase();
guess = guess.substring(0,1);
if( guess.equals("h"))
{
System.out.println("You guessed the coin will come up \"Heads\"");
coinguess = 1;
}
else if(guess.equals("t"))
{
System.out.println("You guessed the coin will come up \"Tails\"");
coinguess = 2;
}
else
{
System.out.println("You enter \"t guess t\" which is NOt \"T\" or \"H\"");
System.out.println("Randomly generating a guess for you ! ");
if(randomguess == 1)
{
System.out.println("Random Guess is Heads");
coinguess = 1;
}
else
{
System.out.println("Random Guess is Tails");
coinguess = 2;
}
}
if (toss == 1)
{
numheads +=1;
System.out.println("coins comes up \"Heads\"");
}
else
{
numtails +=1;
System.out.println("coins comes up \"Tails\"");
}
numcointoses +=1;
CAN SOMEONE HELP ME FINISH THIS