Hey guys I am writing my first program ever in java starting tonight and all has actually gone smooth which has been a surprise but I have run into a problem with an if else area. Basically, what I am suppose to be doing in this section is the user is prompted to either give r, d, or n and depending on their response they receive a different price. No matter what I input I get the price for n (which is 0.00). So I was wondering if anyone knows what might be wrong?
r = 1.00
d = 1.50
n = 0.00
Thank You in Advance!
System.out.println("Type of padding (r = regular, d = delux, n = none)?: ");
padding = sc.next();
System.out.println(padding);
if (sqYard > 3000)
{
carpetCost = price * sqYard * surChargeBig;
System.out.println(carpetCost);
}
else
System.out.println("small");
if (padding == "r")
System.out.println(costRegPad);
else if (padding == "d")
System.out.println(costDlxPad);
else
System.out.println(0.00);