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

Java Problem

Options
  • 26-07-2006 9:39am
    #1
    Registered Users Posts: 357 ✭✭


    I am trying to write a program that is a degree calculator. I have it taking in a value for degrees minutes and second. I am trying to get it to do a "roll-over". When it reachs 60 seconds it'll become one minute 60 minutes 1 degree and 360 degrees rollover to zero. Anyone have ay ideas


Comments

  • Registered Users Posts: 21,264 ✭✭✭✭Hobbes


    Get the modulus of 360 of the number.


  • Registered Users Posts: 357 ✭✭apoch632


    thats like
    (number taken in)%360;

    isn't it


  • Registered Users Posts: 21,264 ✭✭✭✭Hobbes


    Yep. Its the remainder part of the sum.


  • Registered Users Posts: 357 ✭✭apoch632


    thanks man


Advertisement