Coder Social home page Coder Social logo

taxi-meter's Introduction

taxi-meter

出租车计价:

不大于2公里时只收起步价6元。 超过2公里的部分每公里收取0.8元。 超过8公里的部分,每公里加收50%长途费。 停车等待时加收每分钟0.25元。 最后计价的时候司机会四舍五入只收到元。

测试数据:

  • 1公里,等待0分钟
  • 3公里,等待0分钟
  • 10公里,等待0分钟
  • 2公里,等待3分钟

期望输出:

  • 收费6元
  • 收费7元
  • 收费13元
  • 收费7元

需求分析

名词: 出租车计价器 taxi meter 距离 distance 等待时间 waiting time 价格 price 起步价 starting price

动词: 计价 calculate the price

加入标准

通过checkstyle规则

单个Java文件不得超过50行。 单行代码长度不得超过150个字符。 单个方法长度不得超过10行。 单个方法的圈复杂度不得超过4。 单个方法参数个数不得超过3。 友好的方法命名。

测试覆盖率100%,没有严重的Sonar问题。

采用TDD开发模式。

taxi-meter's People

Contributors

kim-huisheng avatar

Watchers

James Cloos avatar jinhuisheng avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.