• Post Reply Bookmark Topic Watch Topic
  • New Topic

Checking conflict time

 
Edrey Ching
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • 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]
 
Campbell Ritchie
Marshal
Posts: 52581
119
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
 
Dave Tolls
Ranch Hand
Posts: 2284
25
  • Mark post as helpful
  • send pies
  • 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.
 
salvin francis
Bartender
Posts: 1407
18
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!