Best fare project

import java.util.ArrayList;
public class TransitCalculator{

  int days;
  int rides;

  public TransitCalculator(int noOfDays, int noOfRides){
    days = noOfDays;
    rides = noOfRides;
  }

  double payPerRide = 2.75;
  double unlimitedRide_7 = 33;
  double unlimitedRide_30 = 127;

  // Returns Price Per Ride using 7-day Unlimited rides option
  public double unlimited7Price(){
    int noOfWeeks = (days / 7) + 1;
    if(days == 7) noOfWeeks = 1;
    double pricePerRide = unlimitedRide_7*noOfWeeks/rides; 
    return pricePerRide;
  }

  // Returns Price Per Ride using 30-day Unlimited rides option
  public double unlimited30Price(){
    int noOfMonths = (days / 30) + 1;
    if(days == 30) noOfMonths = 1;
    double pricePerRide = unlimitedRide_30*noOfMonths/rides; 
    return pricePerRide;
  }

ArrayList<Double> ridePrice = new ArrayList<Double>();

  // returns an arraylist of prices per ride for all three options
  public ArrayList<Double> getRidePrices(){

    ridePrice.add(payPerRide);

    this.unlimited7Price();
    ridePrice.add(unlimited7Price());

    this.unlimited30Price();
    ridePrice.add(unlimited30Price());

    return ridePrice;
  }


  //return the best price option for you
  public String getBestFare(){

    double lowestPrice = 2.75;
    for(int i  = 0;i<ridePrice.size();i++){
      if(ridePrice.get(i)<lowestPrice){
        lowestPrice =ridePrice.get(i);
      }
    }

    return "you should go for "
  } 


  public static void main(String[] args){
    TransitCalculator calculate = new TransitCalculator(19,50);
    
    System.out.println(calculate.getRidePrices());
    System.out.println(calculate.getBestFare());
  }
}

how do I return the statement with no of days and best fare price in getBestFare() method.
someone pls tell

Try string formatting

for example: String.format("%d", 55).

i didn’t understand
please explain breifly

public class Main {
    public static void main(String[] args) {
        System.out.println(String.format("I ate %d pieces of bread this morning", 2));
    }
}
// Output
// I ate 2 pieces of bread this morning

Which implies you can:

public class Main {
    public static void main(String[] args) {
    	int amountBread = 3;
        System.out.println(String.format("I ate %d pieces of bread this morning", amountBread));
    }
}
// Output
// I ate 3 pieces of bread this morning

Did you notice that the idea was to calculate price / ride: if you bought one 30 day ticket and had 30 rides the price would be $127 / 30 (rides) but with - say - 10 rides the price per ride would be $12.70 which would be quite expensive.