Skip to content

Conversation

Rehan-Pathan
Copy link

This pull request finalizes the implementation of the RewardValue class and completes the associated unit tests. The following changes were made:

Implemented RewardValue Class:

Added two constructors for handling both cash and miles input. The class handles the conversion between cash and miles using a predefined conversion rate.
cashValue is converted to milesValue using a conversion rate of 1 mile = $0.0035 and vice versa.
Added Unit Tests:

Test 1: Cash to Miles Conversion: Verifies that cash is properly converted to miles using the conversion rate (cash ÷ 0.0035 = miles).
Test 2: Miles to Cash Conversion: Ensures miles are accurately converted to cash using the reverse conversion (miles × 0.0035 = cash).
Both tests now pass, confirming that the conversion logic works as expected. The class now provides accurate conversions between cash and miles, covering key edge cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant