Question
Formal Methods: Boolean Specification A store has a rewards program: customers receive a discount based on the number of reward points they have acquired and
Formal Methods: Boolean Specification A store has a rewards program: customers receive a discount based on the number of reward points they have acquired and whether they have the status of being a gold customer. Write a Boolean specification (including relational expressions as appropriate) for the program to determine whether a reward is deserved based on the following business rules:
A customer pays full price if the number of reward points is less than 100 and the customer is not a gold customer.
A customer pays full price if the number of reward points is less than 50 and the customer is a gold customer.
A customer receives a discount if the number of reward points is greater than or equal to 100.
A customer receives a discount if the number of reward points is greater than or equal to 50 and the customer is a gold customer.
If the number of reward points is less than 1, print an error message. Write the Boolean specification for the full price, the discount price, and the error condition. Please use the following identifier names for consistency: D = discount received F = full price paid E = error (less than 1 reward point entered) r = number of reward points g = gold customer Grading Rubric Correct specification for full price, 40 points Correct specification for discount, 40 points Correct specification for error, 20 points
Step by Step Solution
3.52 Rating (162 Votes )
There are 3 Steps involved in it
Step: 1
Using the following identifier names for consistency D discount received F full price paid E error less than 1 reward point entered r number of reward ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started