I'm working on getting switch and if statements down and I came up with this. It works well and I don't have any problems with it running properly. I was wondering if I could get some feedback on how I put it together. If there are things I am doing wrong or could do better, I'm very open to suggestions!
public static void main(String[] args) {
double edge = 0;
Scanner sc = new Scanner(System.in);
System.out.println("Enter the name of your Casino.");
String casino = sc.nextLine();
System.out.println("How many decks? (1, 2, 4, 6, 8)");
int decks = sc.nextInt();
System.out.println("Dealer hits Soft 17 (1 for Yes; 2 or No)");
int soft17 = sc.nextInt();
System.out.println("Double after Splits Allowed (1 for Yes; 2 or No)");
int doubleAfterSplit = sc.nextInt();
System.out.println("Double 10/11 Only (1 for Yes; 2 or No)");
int double1011 = sc.nextInt();
System.out.println("Double 9/10/11 Only (1 for Yes; 2 or No)");
int double91011 = sc.nextInt();
System.out.println("Resplit Aces (1 for Yes; 2 or No)");
int rSA = sc.nextInt();
System.out.println("Late Surrender (1 for Yes; 2 or No)");
int lateSurrender = sc.nextInt();
System.out.println("Early Surrender (1 for Yes; 2 or No)");
int earlySurrender = sc.nextInt();
System.out.println("Lose All Doubles/Splits vs. Natural (1 for Yes; 2 or No)");
int loseAllDS = sc.nextInt();
sc.close();
//Number of Decks Option
if (decks == 1) {
edge += 0.01;
} else if (decks == 2) {
edge -= 0.32;
} else if (decks == 4) {
edge -= 0.49;
} else if (decks == 6) {
edge -= 0.54;
} else if (decks == 8) {
edge -= 0.57;
} else {
System.out.println("You made a mistake. Start over.");
}
//Soft 17 Options
if (soft17 == 1) {
edge -= 0.20;
} else {
edge += 0;
}
//Double After Splits Option
if (doubleAfterSplit == 1) {
edge += 0.14;
} else {
edge += 0;
}
//Double 10 and 11 Only Option
if (double1011 == 1) {
edge -= 0.17;
} else {
edge += 0;
}
//Double 9, 10, and 11 Only Option
if (double91011 == 1) {
edge -= 0.08;
} else {
edge += 0;
}
//Resplit Aces Option
if (rSA == 1) {
edge += 0.08;
} else {
edge += 0;
}
//Late Surrender Option
if (lateSurrender == 1) {
edge += 0.08;
} else {
edge += 0;
}
//Early Surrender Option
if (earlySurrender == 1) {
edge += 0.65;
} else {
edge += 0;
}
//Lose on All Doubles and Splits vs Natural Option
if (loseAllDS == 1) {
edge -= 0.11;
} else {
edge += 0;
}
DecimalFormat newFormat = new DecimalFormat("#.##");
edge = Double.valueOf(newFormat.format(edge));
System.out.print("At, " + casino + " ");
if (edge >= 0) {
System.out.print("your advantage is: " + edge + "%");
} else {
System.out.print("your disadgantage is: " + edge + "%");
}
}
}