Fair Calculator more help

So i am completely mixed up. I have no idea what iv have done wrong but cant getBestFair method to work for the life of me. Any help is appreciated

<class TransitCalculator{

int days;

int rides;

public TransitCalculator(int numOfDays, int numOfRides){

days = numOfDays;

rides = numOfRides;

String pass = {“Pay-per-ride”, “7 day unlimited”, “30 day unlimited”};

double price = {2.75, 33, 127};

}

public double unlimited7Price(){

double weeksNeeded = days/7;

double totalWeeks = Math.ceil(weeksNeeded)+1;

double unlimited7Day = (totalWeeks*33)/rides;

return unlimited7Day;

}

public double getRidePrices(){

double unlimited7 = unlimited7Price();

double payPer = 2.75;

double thirtyDay = 127/rides;

double ridePrices = {payPer, unlimited7, thirtyDay};

return ridePrices;

}

public String getBestFare(){

double ridePrices2 = getRidePrices();

int winningIndex = 0;

for(int i = 0; i < ridePrices2.length; i++){

if(ridePrices[i] < ridePrices[winningIndex])

{

``````winningIndex = i;}}

return "you should get the " + pass[winningIndex] + " option at \$" +ridePrices[winningIndex] + " per ride.";
``````

}>

A post was merged into an existing topic: Fair Calculator