Computer Science > STUDY GUIDE > Assignment 7 University of Texas, Dallas CS 3354 (All)
Name CS 3354.501 A07, Formal Methods: Boolean Specification 13th October 2020 A store has a rewards program: customers receive a discount based on the number of reward points they have acquired a... nd 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. if(r < 100 && !g) F = true; • A customer pays full price if the number of reward points is less than 50 and the customer is a gold customer. if(r < 50 && g) F = true; • A customer receives a discount if the number of reward points is greater than or equal to 100. if(r >= 100) D = true; • 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(r >= 50 && g) D = true; • If the number of reward points is less than 1, print an error message. if(r <1) print E; 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 [Show More]
Last updated: 2 years ago
Preview 1 out of 2 pages
Buy this document to get the full access instantly
Instant Download Access after purchase
Buy NowInstant download
We Accept:
Can't find what you want? Try our AI powered Search
Connected school, study & course
About the document
Uploaded On
Nov 08, 2022
Number of pages
2
Written in
This document has been written for:
Uploaded
Nov 08, 2022
Downloads
0
Views
97
In Scholarfriends, a student can earn by offering help to other student. Students can help other students with materials by upploading their notes and earn money.
We're available through e-mail, Twitter, Facebook, and live chat.
FAQ
Questions? Leave a message!
Copyright © Scholarfriends · High quality services·