Giter VIP home page Giter VIP logo

tdd-fizzbuzz's Introduction

Real FizzBuzz

Step 1:

Write a class that produces the following for any contiguous range of integers:

  • ‘fizz’ for numbers that are multiples of 3
  • ‘buzz’ for numbers that are multiples of 5
  • ‘fizzbuzz’ for numbers that are multiples of 15

Running the program with a range from 1-20 should produce the following result:

1 2 fizz 4 buzz fizz 7 8 fizz buzz 11 fizz 13 14 fizzbuzz 16 17 fizz 19 buzz

Step 2:

Please enhance your existing FizzBuzz solution to perform the following:

If the number contains a three you must output the text ‘lucky’. This overrides any existing behaviour

Running the program with a range from 1-20 should produce the following result:

1 2 lucky 4 buzz fizz 7 8 fizz buzz 11 fizz lucky 14 fizzbuzz 16 17 fizz 19 buzz

Step 3:

Finally, please enhance your existing solution to perform the following:

Produce a report at the end of the output showing how many times the following were printed:

  • fizz
  • buzz
  • fizzbuzz
  • lucky
  • an integer

Running the program with a range from 1-20 should produce the following result:

1 2 lucky 4 buzz fizz 7 8 fizz buzz 11 fizz lucky 14 fizzbuzz 16 17 fizz 19 buzz fizz: 4 buzz: 3 fizzbuzz: 1 lucky: 2 integer: 10

(Integer is 10 because there were 10 numbers that were not altered)

tdd-fizzbuzz's People

Contributors

abidk 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.