473,325 Members | 2,712 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Preconditions

115 100+
When you are asked in a question to specify a precondition as a valid boolean expression for a certain procedure. Is this just a comment within the procedure or do you have to write an if statement where the outcome is true? This is on a PDL question.
Jul 6 '07 #1
3 1967
weaknessforcats
9,208 Expert Mod 8TB
A pre-condition occurs before the procedure.
A post-condition occurs after the procedure.

Expand|Select|Wrap|Line Numbers
  1.  
  2. PreCondition();
  3.  
  4. // the procedure
  5.  
  6. PostCondition();
  7.  
All the boolean would mean is if the procondition were true then execute the procedure:

Expand|Select|Wrap|Line Numbers
  1.  
  2. if (PreCondition())
  3. {
  4.  
  5. // the procedure
  6. }
  7. PostCondition();
  8.  
Jul 6 '07 #2
JosAH
11,448 Expert 8TB
Also note that if the precondition fails, it's the caller's fault. If the postcondition
fails it's the callee's fault.

kind regards,

Jos
Jul 6 '07 #3
truezplaya
115 100+
thank you very much for that help. Thats put it clear for me now :P
Jul 10 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Fernando Rodriguez | last post by:
Hi, I have a class Preconditions that has a metaclass (MetaChecker), but I guess I somehow screwed things up with the metaclass definition... When I create an instance of Preconditions, I get...
6
by: Bart Nessux | last post by:
Should an if statement have a corresponding else statement? Or, is it OK to have an if statement by itself. For completeness, it seems the two should be together, but from experience I know that a...
17
by: BlindHorse | last post by:
Help!!! I need someone to tell me why I am getting the err msg error C2440: '=' : cannot convert from 'char *' to 'char' //==================== #include <iostream>
14
by: Julia | last post by:
Hi, When writing class library do you validate ALL incoming parameters? Is this a good approach,to valid them ALL!!!,and throw exceptions? I realize that if I am not validating them,than my...
28
by: jakk | last post by:
Hello All, I have a question about how to handle exceptions. Iam working on an ASP.NET application which has a presentation layer, Business Layer and DataAccess Layer. Iam confused about where...
14
by: Divick | last post by:
Hi, is it a nice idea to do assetion checks for method arguments ? I am currently redesigning a piece of code. Now the problem is that there are some assumptions for the method arguments that the...
4
by: Tom Bradford | last post by:
Let me first say that I'm sure that this subject has come up before, and so forgive me for beating a dead horse. Secondly, let me say that Python's strength is its dynamic nature, and I don't...
669
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Language”, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic...
1
by: bhanusharma | last post by:
i neeeeeeeeeed help . please help me! very urgent!!!!!!!!!!!!!!!!!!!!!int seconds_in_minutes(int minutes); i need precondition and postconditionand assert statement. for example...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.