Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jul 2012
    Location
    NYC
    Posts
    23
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Need help with Boolean Statements?

    This is the code I got from my programming book, a relatively simple demonstration of Boolean statements in Java.

    public class Main {


    public static void main(String[] args) {
    if (salesTotal <10000)
    {
    if (salesClass ==1)
    commissionRate = 0.02;

    }
    else
    {

    if (salesClass == 1)
    commissionRate = 0.025

    }


    This code received, from the compiler, messages ranging from "} missing" to "Main method is missing". I don't know what to do, does anybody here know?
    Last edited by dannyboi; 08-11-2012 at 01:54 AM.

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,980
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    If that's all you have, then of course you have a lot of compilation errors.
    You need to specify the class and the method (likely main if you are trying to execute it). Otherwise, post the entire relevant class. Make sure its wrapped in [code][/code] or [php][/php] tags.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •