![]() |
|
#1
|
|||
|
|||
Date problemHi, just got a question. I'm creating a program which is basically calculating quote for a carpet laying business. Basically, the person has a choice of vinyl and timber (this is user input). If a person chooses vinyl, then the installation cost is 2 business days after the quote (the quote is generated from the system date. so if i ran the program completely compiled today, then today is my quote), and if the choice is timber, then the installation for that is 2 weeks. So basically my program needs to determine which floor type the user wants, and if the quote is generated today (21/3/06) and its vinyl, my program must output “the installation date is on the 23/6/06). And yes, if the choice is timber, then it’ll just output the date from 2 weeks from now exactly. The timber side of things, I have completed fine, but I’m having a problem with the vinyl. Of course, if my quote is generated on Thursday, then the installation laying date should be (on the monday of the following day….as you can imagine, if its done on a Thursday, then it’ll Friday, Saturday, Sunday, Monday …of course, you do not count Saturday and Sunday as business days). So far my code is as follows.
JAVA Code:
(then in main I have this) JAVA Code:
2. Of course, you can see my if statement for timber is done (and working), just not sure how to go about doing the vinyl part. Cheers Just incase you need this, i have these packages. JAVA Code:
Last edited by LuciWiz : 21-Mar-2006 at 01:44.
Reason: Please insert your Java code between [java] & [/java] tags
|
|||
|
#2
|
||||
|
||||
Re: Date problemFirst, you say in the beginning that timber is 2 weeks, but you only add 7 days?
JAVA Code:
Then for the other part, why not just add the 2 days, and then check the day of the new date? If the new date happens to be Saturday, add two more days, if Sunday add one more day: JAVA Code:
__________________
Use the force...read the source!! WYCIWYG -- what you code is what you get! |
Recent GIDBlog
Problems with the Navy (Enlisted) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Graphic problem in Unreal Tournament 2004 | zerox | Computer Software Forum - Games | 10 | 09-Oct-2005 12:31 |
| Runtime Problem involving "printf" in C Program | supamakia | C Programming Language | 2 | 09-Oct-2005 10:09 |
| a significant problem after installing Xp | mohammad | Computer Software Forum - Windows | 10 | 09-Aug-2005 07:03 |
| problem on typedef | fwongmc | C Programming Language | 10 | 24-Dec-2004 03:54 |
| Rookie problem with date format | cave monkey | MySQL / PHP Forum | 4 | 18-Mar-2004 08:41 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The