Corticon Studio: Rule Modeling Guide : Rules containing calculations and equations : Test yourself questions: Rules containing calculations and equations

Test yourself questions: Rules containing calculations and equations

Note: Try this test, and then go to Test yourself answers: Rules containing calculations and equations to correct yourself.
1. What are the two possible meanings of the equals operator =? In which sections of the Rulesheet is each of these meanings applicable?
2. What is the result of each of the following equations?
a. 10 + 20 / 5 – 4
b. 2 * 4 + 5
c. 10 / 2 * 6 – 8
d. 2 ** 3 * (1 + 2)
e. -5 * 2 + 5 * 2
3. Is the following assignments expression valid? Why or why not? Entity1.integer1 = Entity1.decimal1
4. What is the data type of each of the following expressions based on the scope shown below?
e1.dateTime1.year
e1.string1.toUpper
e2 -> forAll (integer1 = 10)
e2.decimal1 -> avg
e1.boolean1
e1.decimal1 > e1.decimal2
e2.string2.contains(‘abc')
5. Write valid or invalid for each of the following assignments
e1.decimal1 = e2.integer1
e2.decimal2 = e2.string2
e1.integer1 = e2.dateTime1.day
e2.integer1 = e2 -> size
e1.boolean2 = e2 -> exists (string1 = ‘abc')
e2.boolean2 = e1.string1.toBoolean
e1.boolean2 = e2 -> isEmpty
6. The part of Corticon Studio that checks for syntactical problems is called the __________.
7. True or False. If an expression typed in Corticon Studio does not turn red, then the expression is guaranteed to work as expected.
Referring to the following illustration, answer questions 8 through 10:
8. What does Filters row 1 test?
9. What does Conditions row a test? Is there a simpler way to accomplish this same thing using a different operator available in the Corticon Rule Language?
10. Write a Rule Statement for rule column 1. (Assume that the only action required for this rule is to post a Warning message as shown.)
11. True or False. The following sections of the Rulesheet accept equations and calculations:
Scope
Rule Statements
Condition rows
Action rows
Column 0
Condition cells
Action cells
Filters