Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added class RewardValue #1438

Open
wants to merge 1 commit into
base: flow
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions src/main/java/RewardValue.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
public class RewardValue {
private double cashValue;
private double milesValue;

private static final double MILES_TO_CASH_RATE = 0.0035;


public RewardValue(double cashValue) {
this.cashValue = cashValue;
this.milesValue = cashValue / MILES_TO_CASH_RATE;
}

public RewardValue(int milesValue) {
this.milesValue = milesValue;
this.cashValue = milesValue * MILES_TO_CASH_RATE;
}


public double getCashValue() {
return cashValue;
}


public double getMilesValue() {
return milesValue;
}
}