Skip to content

need-for-speed: analyzer suggests not using loop to determine if car can finish the track #320

@133j

Description

@133j

Although you can technically calculate if a car can finish the track by a combination of track distance, the speed and battery drain of the car, the analyzer is incorrect to suggest calculating the answer rather than looping.

The only exposed methods are to drive, get remaining battery, and distance traveled. None of those should give you the speed or battery drain steps of the car. Those should not be public fields.

It is incorrect for the analyzer to suggest implementing canFinishRace with simple math when this method belongs to another class.

If the fields were actually meant to be public, and hopefully not, then those methods written for the class are moot for the culmination of this exercise.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions