Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Help creating java program

Options
  • 23-09-2009 9:01pm
    #1
    Registered Users Posts: 3,599 ✭✭✭


    This post has been deleted.


Comments

  • Closed Accounts Posts: 1,619 ✭✭✭Bob_Harris


    Has your lecturer mentioned the concept of pseudocode?

    It's writing out in English, with the formatting of code, describing the steps involved in achieving what you need done.

    eg.
    import required classes
    
    print explanation of program
    
    print request for user input
    
    set up input from keyboard and save input to variable (e.g. inputNumber)
    
    set up a variable to hold the take home pay amount (e.g. takeHomePay)
    
    if inputNumber is less than 10,000
    then
    	print not eligible for tax.
    	takeHomePay equals inputNumber
    
    else if inputNumber is greater than or equal to 10,000 and if inputNumber is less than 25,000
    then
    	get 28% of inputNumber and print on screen
    	takeHomePay equals inputNumber minus tax
    
    else if inputNumber is greater than or equal to 25,000
    then
    	get 45% of inputNumber and print on screen
    	takeHomePay equals inputNumber minus tax
    
    end if
    
    print takeHomePay
    


  • Registered Users Posts: 5,015 ✭✭✭Ludo


    uh oh...serious miscalculation in that pseudo code .

    I hope you aren't writing any code for the Revenue :D


  • Registered Users Posts: 3,599 ✭✭✭sashafierce


    This post has been deleted.


  • Closed Accounts Posts: 1,619 ✭✭✭Bob_Harris


    Ludo wrote: »
    uh oh...serious miscalculation in that pseudo code .

    I hope you aren't writing any code for the Revenue :D

    Is there? Is it the take home pay? I actually don't really understand tax :pac:
    This post has been deleted.

    Write your pseudo code, and replace line by line with the correct code. Pseudo code helps you sort out the structure of your program and the logic, it's up to you to then use the documentation you have at hand to use the right syntax, classes and methods / functions.


  • Closed Accounts Posts: 1,326 ✭✭✭waraf


    This post has been deleted.

    Hi Sashafierce, can I just give you a quick tip. If you're looking for programming help on internet forums, the only way most people will be willing to help is if you post your attempt at the code first. People aren't going to do your homework for you but most people will be willing to help if you post code that you can't get to compile. So basically have a crack at it yourself and if/when you get stuck give us a shout....


  • Advertisement
  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    Please have a read of the forum charter regarding the homework rules before posting again.


This discussion has been closed.
Advertisement