• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Checking conflict time

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Help! I have two tables here table1 and table2 when I clicked "ADD SUBJECT" button the button will check first if the selected subject will not going to conflict or overlap to the time of the subjects that already added in table2, and if the selected subject will not overlap to any of the time in table2 then it will be added to table2 , else some a pop-up warning saying that the selected subject overlap to another subject.
Conflict_Time.png
[Thumbnail for Conflict_Time.png]
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That looks like a scheduling or timetabling algorithm. How are you planning to check for overlaps? No Java® or other code permitted in the answer.

When you have explained it carefully in plain simple English/German/Latin/Mandarin/Tagalog/OtherLanguage you can probably turn that into code easily.
 
Edrey Ching
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you understand tagalog ? so I can explain it easily ?
 
Edrey Ching
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Its like this, a user will select first what subject he/she wants to add, lets assume that he/she selected the Math, Math subject time start at 8:00 am and end at 10:00 am this subject overlap the time of English which is the start of the class is at 9:00 am, therefor Math subject cannot be added because there will be a conflict schedule between the two subjects. that's what I m trying to say. Thanks in advance
 
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think Campbell understands that.

What he's asking is for you to come up with a description of how you would do this, by hand.
In other words, what algorithm you would use.

No Java required for this bit.
 
Bartender
Posts: 2911
150
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Edrey Ching wrote: Its like this, a user will select first ...


You are explaining the problem, not the solution.

Let me ask in another way:
If Maths is 8am to 10am

Explain why following wont work:
1. English at 7am to 9am
2. English at 9am to 11am
3. English at 8am to 10am
4. English at 8:30am to 9:30am
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic