Ejemplo n.º 1
0
    public FareResponse GetResponse(float directDistance, float journeyTime, float price)
    {
        FareResponse response = new FareResponse();
        float        speed    = FareTools.getSpeedMph(directDistance, journeyTime);

        if (speed >= ReasonableSpeed)
        {
            response.Payment = price * FastRideMultiple;
            response.verbal  = "Thanks a bunch!";
        }
        else
        {
            response.Payment = price * SlowRideMultiple;
            response.verbal  = "Thanks.";
        }
        return(response);
    }
Ejemplo n.º 2
0
    public FareResponse GetResponse(float directDistance, float journeyTime, float price)
    {
        FareResponse response = new FareResponse();
        float        speed    = FareTools.getSpeedMph(directDistance, journeyTime);

        if (speed >= ReasonableSpeed)
        {
            response.Payment = price * speed / ReasonableSpeed;
            response.verbal  = "Keep the change!";
        }
        else if (speed >= 0.5f * ReasonableSpeed)
        {
            response.Payment = price;
            response.verbal  = "That was adequate.";
        }
        else
        {
            response.Payment = 0.5f * price;
            response.verbal  = "Forget it! You're lucky I'm paying you at all!";
        }
        return(response);
    }