- You can use Gradle to create a Java Project - you can name it LoyaltyPoints.
- Copy
PointsCalculatorTest.java
under packageloyaltyPoints
withinsrc/test/java
- Copy
Tier.java
,PrivilegeService.java
,PointsCalculator.java
andCustomer.java
under packageloyaltyPoints
withinsrc/main/java
- Add JUnit4 or JUnit5 Jar or latest JUnit as a test dependency.
- Run the tests to get a green bar.
An airline has following rules for calculating bonus amount for loyalty points for a customer based on which tier they are in:
- If a customer is in Platinum tier, add 50% more points above regular points.
- If a customer is in Gold tier, add 30% more points above regular points.
- If a customer is in Silver tier, add 15% more points above regular points.
- If a customer is in Blue tier, then there are no bonus points, just regular points.
- Spending INR 100 earns a regular point.
I want to add Titanium Tier, that gives 75% more points above regular points, can you help me?
If you are behind proxy, and use gradle as a build tool, you can add the following lines to gradle.properties:
systemProp.http.proxyHost=Proxy IP Address
SystemProp.http.proxyPort=83
systemProp.https.proxyHost=Proxy IP Address
SystemProp.https.proxyPort=83
If you are behind proxy, and use
gradle
as a build tool, you can add the following lines togradle.properties
: