mmm4444bot
Super Moderator
- Joined
- Oct 6, 2005
- Messages
- 10,962
What's your programming environment? Are there any built-in date/time functions?
Ah, sounds good.I’m using a mix of PHP and JavaScript …
… There’s plenty of built in commands including DateTime::diff which will find the difference between two times and output the result in hours, minutes, etc. …
… Basically anything you need to write this is in it. If you have any experience in programming, this may be easy for you.
Unfortunately, I've lost access time to computers because of forest fires. (In August, Seattle experienced the worst air quality ever recorded. This went on for days; I was forced to leave town more than once, during the last two weeks.)Just wondering when you will have this finished?
Just FYI: The helpers here are volunteers who give of their time when and as they're able. They don't "do" students' homework for them, nor is there any expectation that they will write essays, construct software, or provide other professional services on any sort of on-demand basis. Instead, they try to help people learn how to succeed on their own. Thank you!Just wondering when you will have this finished?
Hi. I take back the statement above; I realized yesterday that the coding approach in post #28 amounts to using the same algorithm for each customer. That is, each block could be processed (block hours summed, as tiered price determined for each) using the same loop, so the one-size-fits all pricing scheme above (versus strict adherence to the charge-reset boundaries -- encoded within the processing loop, anyway) doesn't have any benefit from a coding point of view. It also doesn't matter whether a customer starts with daily rates or nightly rates, or a full-block or partial-block, or what order the block charges are summed. I mispoke.… Easiest way from a coding perspective is to not have exceptions and charge everybody $15 for exceeding [04:05] regardless of whether the overage is 3 minutes or 3 hours or happens during a charge reset …
Is that your answer to my second question in post #26? Here's the question again:… In any case, more than 4 hours is $15 …
… can you say whether the charge is ever less than $15 for 5 hours of parking?
That's $30 for 10 hours, and the $30 charge matches information on the sign (for that specific check-in).… If someone comes in at 1PM and leaves at 11PM, it would be $30 …
I think you're lost because you don't actually have a set billing system. (I suspect your sign is incorrect.)I'm honestly lost again …
A machine cannot do that. You need a concrete system, before thinking about coding it. You need to discover, and decide upon a charge, for each exception to your signage.… I usually just think about what's fair …
Do I understand this correctly? You own a parking lot, and a guy who paints signs is helping you figure out how to charge customers?… The sign is all the information I have to go by, other than asking the guy that made the sign what should be done in certain scenarios.