import java.text.DecimalFormat;
/**
*
* @author Yuridia
*/
public class a1main
{
public static void main(String[] args)
{
double balance = 0.00;
final double winnings1 = .25;
final double winnings2 = .10;
final double winnings3 = .05;
Coin coin = new Coin();
Coin coin2 = new Coin();
Coin coin3 = new Coin();
coin.toss();
coin2.toss();
coin3.toss();
System.out.printf("The quarter landed on " + coin.getSideUp() + ".\n");
System.out.printf("The dime landed on " + coin2.getSideUp() + ".\n");
System.out.printf("The nickel landed on " + coin3.getSideUp() + ".\n");
{
if ("heads".equals(coin.getSideUp()))
{
coin.addWinnings(winnings1);
System.out.printf("Awarding " + winnings1 + " cents to balance.\n");
System.out.printf("Your current balance is now " + coin.getBalance() + ".\n");
if ("heads".equals(coin2.getSideUp()))
{
coin.addWinnings(winnings2);
System.out.printf("Awarding " + winnings2 + " cents to balance.\n");
System.out.printf("Your current balance is now " + coin.getBalance() + ".\n");
if ("heads".equals(coin3.getSideUp()))
{
coin.addWinnings(winnings3);
System.out.printf("Awarding " + winnings3 + " cents to balance.\n");
System.out.printf("Your current balance is now " + coin.getBalance() + ".\n");
}
}
}}
{
if (balance > 1.00)
{
System.out.printf("Your ending balance is " + balance + " . You lose");
}
if (balance == 1.00)
{
System.out.printf("Your ending balance is $1.00. YOU WIN!!");
}
}}}
--- Update ---
lol! I don't think did that right!