DEAL OR NO DEAL HELP THIS IS URGENT PLEASE HELP ME!!!!!
i have a project due in two days and i must create a deal or no deal game in java the following is the code i have currently created i am not very advanced so this is where i am at so far:
// The "DealorNoDeal" class.
import java.awt.*;
import hsa.Console;
import java.util.Random;
publicclass DealorNoDeal
{
static Console c;
publicstaticvoid main (String[] args)
{
c =new Console (30, 110, 15,"DEAL OR NO DEAL");
//setSize(500,500);
double[] CasesValues ={.01, 1, 5, 10, 25, 50, 75, 100, 200, 300, 400, 500, 750, 1000, 5000, 10000, 25000, 50000, 75000, 100000, 200000, 300000, 400000, 500000, 750000, 1000000};
double[] Case =newdouble [26];
int number = 0, Choosen, Remove = 0, Offer = 0;
double PlayerCase;
Random generator =new Random ();
boolean Picked =false;
char Deal =' ';
boolean Not =false;
String name;
// USER ENTERS THEIR NAME
c.println ("Please enter your name: ");
name = c.readString ();
c.println (" ");
// THIS PUTS THE NUMBERS IN THEIR CASES
for (int i = 1 ; i < 26 ; i++)
{
number = generator.nextInt (26);
Case [i] = CasesValues [number];
}
for (int i = 0 ; i < 13 ; i++)
c.println (CasesValues [i] +"\t\t" + CasesValues [i + 13]);
// THE USER CHOOSES THEIR CASE
c.println ("Please Pick Your Case");
Choosen = c.readInt ();
PlayerCase = Case [Choosen];
c.clear ();
// THE USER PICKS 6 CASES TO REMOVE
for (int x = 1 ; x < 7 ; x++)
{
c.print ("Please Choose Case To Remove: ");
Remove = c.readInt ();
for (int i = 1 ; i < 26 ; i++)
{
if (Remove == i)
{
c.clear ();
c.println ("You Picked Case " + Remove +" That had a value of " + Case [i]);
Case [i] = 0;
}
}
c.println ();
c.print ("Case Numbers Picked: ");
for (int i = 1 ; i < 26 ; i++)
{
if (Case [i] == 0)
c.print (" " + i);
}
c.println ();
}
// CALCULATES AND MAKES OFFER
for (int i = 1 ; i < 26 ; i++)
{
Offer += Case [i];
}
Offer = Offer / 19;
c.clear ();
c.println ("The Offer is: " + Offer);
c.println ("DO YOU ACCPET (Y/N)");
Deal = c.readChar ();
if (Deal =='Y' || Deal =='y')
{
c.clear ();
c.println ("CONGRATS, YOU LEAVE WITH " + Offer +"DOLLARS");
}
elseif (Deal =='N' || Deal =='n')
{
c.println ("ALRIGHT NOW YOU MUST OPEN 5 CASES");
}
// THE USER PICKS 5 CASES TO REMOVE
for (int x = 1 ; x < 6 ; x++)
{
c.print ("Please Choose Case To Remove: ");
Remove = c.readInt ();
for (int i = 1 ; i < 26 ; i++)
{
if (Remove == i)
{
c.clear ();
c.println ("You Picked Case " + Remove +" That had a value of " + Case [i]);
Case [i] = 0;
}
}
c.println ();
c.print ("Case Numbers Picked: ");
for (int i = 1 ; i < 26 ; i++)
{
if (Case [i] == 0)
c.print (" " + i);
}
c.println ();
}
// CALCULATES AND MAKES OFFER
for (int i = 1 ; i < 26 ; i++)
{
Offer += Case [i];
}
Offer = Offer / 14;
c.clear ();
c.println ("The Offer is: " + Offer);
c.println ("DO YOU ACCPET (Y/N)");
Deal = c.readChar ();
if (Deal =='Y' || Deal =='y')
{
c.clear ();
c.println ("CONGRATS, YOU LEAVE WITH " + Offer +"DOLLARS");
}
elseif (Deal =='N' || Deal =='n')
{
c.println ("ALRIGHT WE WILL CONTINUE TO OPEN CASES");
}
// THE USER PICKS 4 CASES TO REMOVE
for (int x = 1 ; x < 5 ; x++)
{
c.print ("Please Choose Case To Remove: ");
Remove = c.readInt ();
for (int i = 1 ; i < 26 ; i++)
{
if (Remove == i)
{
c.clear ();
c.println ("You Picked Case " + Remove +" That had a value of " + Case [i]);
Case [i] = 0;
}
}
c.println ();
c.print ("Case Numbers Picked: ");
for (int i = 1 ; i < 26 ; i++)
{
if (Case [i] == 0)
c.print (" " + i);
}
c.println ();
}
// CALCULATES AND MAKES OFFER
for (int i = 1 ; i < 26 ; i++)
{
Offer += Case [i];
}
Offer = Offer / 10;
c.clear ();
c.println ("The Offer is: " + Offer);
c.println ("DO YOU ACCPET (Y/N)");
Deal = c.readChar ();
if (Deal =='Y' || Deal =='y')
{
c.clear ();
c.println ("CONGRATS, YOU LEAVE WITH " + Offer +"DOLLARS");
}
elseif (Deal =='N' || Deal =='n')
{
c.println ("ALRIGHT WE WILL CONTINUE BY OPENING 3 CASES");
}
// THE USER PICKS 3 CASES TO REMOVE
for (int x = 1 ; x < 4 ; x++)
{
c.print ("Please Choose Case To Remove: ");
Remove = c.readInt ();
for (int i = 1 ; i < 26 ; i++)
{
if (Remove == i)
{
c.clear ();
c.println ("You Picked Case " + Remove +" That had a value of " + Case [i]);
Case [i] = 0;
}
}
c.println ();
c.print ("Case Numbers Picked: ");
for (int i = 1 ; i < 26 ; i++)
{
if (Case [i] == 0)
c.print (" " + i);
}
c.println ();
}
// CALCULATES AND MAKES OFFER
for (int i = 1 ; i < 26 ; i++)
{
Offer += Case [i];
}
Offer = Offer / 7;
c.clear ();
c.println ("The Offer is: " + Offer);
c.println ("DO YOU ACCPET (Y/N)");
Deal = c.readChar ();
if (Deal =='Y' || Deal =='y')
{
c.clear ();
c.println ("CONGRATS, YOU LEAVE WITH " + Offer +"DOLLARS");
}
elseif (Deal =='N' || Deal =='n')
{
c.println ("ALRIGHT," + name +"YOU MUST CHOOSE 2 CASES TO OPEN NOW");
}
// THE USER PICKS 2 CASES TO REMOVE
for (int x = 1 ; x < 3 ; x++)
{
c.print ("Please Choose Case To Remove: ");
Remove = c.readInt ();
for (int i = 1 ; i < 26 ; i++)
{
if (Remove == i)
{
c.clear ();
c.println ("You Picked Case " + Remove +" That had a value of " + Case [i]);
Case [i] = 0;
}
}
c.println ();
c.print ("Case Numbers Picked: ");
for (int i = 1 ; i < 26 ; i++)
{
if (Case [i] == 0)
c.print (" " + i);
}
c.println ();
}
// CALCULATES AND MAKES OFFER
for (int i = 1 ; i < 26 ; i++)
{
Offer += Case [i];
}
Offer = Offer / 5;
c.clear ();
c.println ("The Offer is: " + Offer);
c.println ("DO YOU ACCPET (Y/N)");
Deal = c.readChar ();
if (Deal =='Y' || Deal =='y')
{
c.clear ();
c.println ("CONGRATS, YOU LEAVE WITH " + Offer +"DOLLARS");
}
elseif (Deal =='N' || Deal =='n')
{
c.println ("ALRIGHT," + name +"YOU MUST CHOOSE 1 CASE TO OPEN NOW");
}
// THE USER PICKS 1 CASES TO REMOVE
for (int x = 1 ; x < 2 ; x++)
{
c.print ("Please Choose Case To Remove: ");
Remove = c.readInt ();
for (int i = 1 ; i < 26 ; i++)
{
if (Remove == i)
{
c.clear ();
c.println ("You Picked Case " + Remove +" That had a value of " + Case [i]);
Case [i] = 0;
}
}
c.println ();
c.print ("Case Numbers Picked: ");
for (int i = 1 ; i < 26 ; i++)
{
if (Case [i] == 0)
c.print (" " + i);
}
c.println ();
}
// CALCULATES AND MAKES OFFER
for (int i = 1 ; i < 26 ; i++)
{
Offer += Case [i];
}
Offer = Offer / 4;
c.clear ();
c.println ("The Offer is: " + Offer);
c.println ("DO YOU ACCPET (Y/N)");
Deal = c.readChar ();
if (Deal =='Y' || Deal =='y')
{
c.clear ();
c.println ("CONGRATS, YOU LEAVE WITH " + Offer +"DOLLARS");
}
elseif (Deal =='N' || Deal =='n')
{
c.println ("ALRIGHT," + name +"YOU MUST CHOOSE 1 CASE TO OPEN NOW");
// THE USER PICKS 1 CASES TO REMOVE
for (int x = 1 ; x < 2 ; x++)
{
c.print ("Please Choose Case To Remove: ");
Remove = c.readInt ();
for (int i = 1 ; i < 26 ; i++)
{
if (Remove == i)
{
c.clear ();
c.println ("You Picked Case " + Remove +" That had a value of " + Case [i]);
Case [i] = 0;
}
}
c.println ();
c.print ("Case Numbers Picked: ");
for (int i = 1 ; i < 26 ; i++)
{
if (Case [i] == 0)
c.print (" " + i);
}
c.println ();
}
// CALCULATES AND MAKES OFFER
for (int i = 1 ; i < 26 ; i++)
{
Offer += Case [i];
}
Offer = Offer / 3;
c.clear ();
c.println ("The Offer is: " + Offer);
c.println ("DO YOU ACCPET (Y/N)");
Deal = c.readChar ();
if (Deal =='Y' || Deal =='y')
{
c.clear ();
c.println ("CONGRATS, YOU LEAVE WITH " + Offer +"DOLLARS");
}
elseif (Deal =='N' || Deal =='n')
{
c.println ("ALRIGHT," + name +"YOU MUST CHOOSE 1 CASE TO OPEN NOW");
}
// THE USER PICKS 1 CASES TO REMOVE
for (int x = 1 ; x < 2 ; x++)
{
c.print ("Please Choose Case To Remove: ");
Remove = c.readInt ();
for (int i = 1 ; i < 26 ; i++)
{
if (Remove == i)
{
c.clear ();
c.println ("You Picked Case " + Remove +" That had a value of " + Case [i]);
Case [i] = 0;
}
}
c.println ();
c.print ("Case Numbers Picked: ");
for (int i = 1 ; i < 26 ; i++)
{
if (Case [i] == 0)
c.print (" " + i);
}
c.println ();
}
// CALCULATES AND MAKES OFFER
for (int i = 1 ; i < 26 ; i++)
{
Offer += Case [i];
}
Offer = Offer / 2;
c.clear ();
c.println ("The Offer is: " + Offer);
c.println ("DO YOU ACCPET (Y/N)");
Deal = c.readChar ();
if (Deal =='Y' || Deal =='y')
{
c.clear ();
c.println ("CONGRATS, YOU LEAVE WITH " + Offer +"DOLLARS");
}
elseif (Deal =='N' || Deal =='n')
{
c.println ("NOW ITS TIME TO OPEN ONE MORE CASE");
}
// THE USER PICKS 1 CASES TO REMOVE
for (int x = 1 ; x < 2 ; x++)
{
c.print ("Please Choose Case To Remove: ");
Remove = c.readInt ();
for (int i = 1 ; i < 26 ; i++)
{
if (Remove == i)
{
c.clear ();
c.println ("You Picked Case " + Remove +" That had a value of " + Case [i]);
Case [i] = 0;
}
}
c.println ();
c.print ("Case Numbers Picked: ");
for (int i = 1 ; i < 26 ; i++)
{
if (Case [i] == 0)
c.print (" " + i);
}
c.println ();
}
// CALCULATES AND MAKES OFFER
for (int i = 1 ; i < 26 ; i++)
{
Offer += Case [i];
}
Offer = Offer / 2;
c.clear ();
c.println ("The Offer is: " + Offer);
c.println ("DO YOU ACCPET (Y/N)");
Deal = c.readChar ();
if (Deal =='Y' || Deal =='y')
{
c.clear ();
c.println ("CONGRATS, YOU LEAVE WITH " + Offer +"DOLLARS");
}
elseif (Deal =='N' || Deal =='n')
{
c.println ("NOW ITS TIME TO OPEN YOUR CASE, YOUR CASE CONTAINED " + (Offer * 2) +" DOLLARS");
}
}
}
}
i would really appreciate it if you could show me how to tell the player when they have already chose a case and not let them choose it again and if possible have all the values display and eliminate the values as they the cases are opened my e-mail is doctor_j_25@hotmail.com if you can e-mail there or add me on msn it would be really appreciated also for future reference thanks

