I can't figure this out! Please help!
I am taking my first java class so I am not very good at this. My problem is that I can't figure out how to make part of my code work. Everything works but this part. I know it is wrong, but I have no idea how else to do it. I feel bad e-mailing my teacher on the weekend, so if you guys help me I would really appreciate it. Thank you very much!
HTML Code:
System.out.println("Do you want trees to be delivered? \n"
+"1 for Yes\t"
+ "0 for No");
forDelivery = keyboard.nextInt();
if(forDelivery == 1)
{
(singleTree < 5) && (deliveryCost== 10.00) // this is the area that I have
(singleTree >=5) && (deliveryCost==50.00)// no clue how to write properly
System.out.println("There will be a delivery charge according to how many trees you ordered.");
else if (forDelivery == 0)
{
System.out.println("In-Store Pickup will be available after 4 PM");
}
}
Re: I can't figure this out! Please help!
Say what the problem is: ie what happens when you run the code, and what you expect or want to happen.
Also it may be a good idea to clean up the format of the code. Remove any distracting left hand indents if they are common to all the lines. And have the { and } pairs line up (with any nested pairs also lining up, but with more indent.)
Re: I can't figure this out! Please help!
Please explain the problem and expected result?