• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Java Calendar - to manipulate in hours basis

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have an assignment as below. Please guide me if you have any ideas.

Assumption: There is a calender already defined which contains working and non-working day list for a whole year.

I have to create a Calender function whcih takes 2 parameters: one is a date (date of an event) and other is an integer (number of days to complete the event - turn around time).

Now add the int value to event date to find the turn around date, but there may be holidays or non-working days in between. If a holiday is encountered, then add one extra day to the turn around date.

Now the problem is to have the calendar in both days and hours based capabilities. I was able to design the days based calendar but I am blinking my eyes to have the hours based calendar feature.

Any help is greatly appreciated. If this is not clear, I can explain again.
 
Marshal
Posts: 79699
381
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What have you done so far?

Write down on a piece of paper, in very simple words, exactly how you intend to do the hours-based task. You need to get down to the level of detail where you are writing "add 3" or "divide by 24" and own to the level of simplicity where you use no words with more than 6 letters. That is pseudocode; once you have the pseudocode, you can very easily turn it into real code.
 
Ranch Hand
Posts: 220
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
DO YOUR HOMEWORK
 
Campbell Ritchie
Marshal
Posts: 79699
381
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Vinod Vijay wrote:DO YOUR HOMEWORK

I had already given a link to that FAQ, so I am not convinced you added anything useful there. And please avoid writing all upper-case.
 
The two armies met. But instead of battle, they decided to eat some pie and contemplate this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic