Git Product home page Git Product logo

tracktik's Introduction

Hi

Here comes my solution for TrackTik PHP Backend challange. I have separated the main classes to make it easier to view them on screen.

Before you run

  1. This code in compatible with PHP 7.2+
  2. The main file is index.php

Coding Style

I tried to apply the PSR-2 conceptions along with part of SOLID elements.

Premises/Considerations

  1. There must be an extras number validation
  2. Controllers can have their own price
  3. Controller price is added to product price in "total price calculation"

Bug fixed from original code

  1. Sorting by price function returns bool value intead of the list
  2. Sorting by price function merges items with the same price

Scenarios

Console

  • Price 500
  • Wired controllers 2x 25
  • Remote controllers 2x 60
  • Total Price 670

TV 1

  • Price 900
  • Remote controllers 2x20
  • Total Price 940

TV 2

  • Price 400
  • Remote controllers 20
  • Total Price 420

Microwave

  • Price 90
  • Total Price 90

Total

2120

tracktik's People

Contributors

shayllis avatar

Watchers

 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.