Enrol to start learning
Reading is open to everyone. Enrolling is free, and it is what unlocks the audio lessons, practice tests and progress tracking.
29.12. Practical Example: Business Rule Engine
This section
Practice test
11 questions on this section. Wrong answers show you what to read again.
Sign up to take itWhole chapter
Revision test
Mixed questions from across the chapter. Your answers get marked.
Sign up to take itQuick
Flashcard drill
3 cards from this lesson. Good the night before a test.
Try these first
- 1.
What is the purpose of the Bindings object?
Hint
Think about what you need to do to reference Java variables in a script.
- 2.
What simple condition does the example script check?
Hint
Recall the structure of the if-else statement.
- 3.
What is the main purpose of the Bindings object in the context of scripting?
- To store Java methods
- To pass Java variables into scripts
- To increase script execution speed
Hint
Think about how scripts access Java variables.
- 4.
True or False: The discount is fixed at 10% regardless of the order total.
- True
- False
Hint
Make sure to remember what the script checks during evaluation.
- 5.
Create a script that calculates a discount based on three tiers: 15% for orders above 2000, 10% for orders between 1000-2000, and 5% for orders below 1000. Implement this in a Java application.
Hint
Break down the conditions carefully and ensure you apply the correct logic.
- 6.
Implement a logging mechanism that records each discount applied based on the order total in a Java application using bindings.
Hint
Think about how JavaScript syntax enables printing to the console.
Exercises
Total Questions
2
Estimated Time
4 min
Passing Score
70%
Instructions
- Read each question carefully
- You can use hints if you need help
- Complete all questions before submitting
3 more questions available
Enrol freeQuiz
Total Questions
2
Estimated Time
4 min
Passing Score
70%
Instructions
- Read each question carefully
- You can use hints if you need help
- Complete all questions before submitting
2 more questions available
Enrol freeChallenge Problems
Total Questions
2
Estimated Time
4 min
Passing Score
70%
Instructions
- Read each question carefully
- You can use hints if you need help
- Complete all questions before submitting