Skip to content

kmagdziarz/alfresco-fizzbuzz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Alfresco FizzBuzz

The problem

This is a simple variation on the well known http://codingdojo.org/kata/FizzBuzz/ kata exercise.

Feel free to change whatever you want of the existing boilerplate code, it's there just to save you set up time.

Technical details

It's a maven based project, so it should be easy to import it in your favourite IDE. There are some Junit 5 test cases. They can be executed from the IDE or from the command line by running:

mvn test

We use LTS Java version 17 and Java 17 is the baseline here. Feel free to use any Java version (17 or above) which works for you. You can change the java version in the pom.xml file by editing following line:

<java.version>17</java.version>

Tasks

There are 2 tasks. They depend on each other so start with Task 1 then continue with Task 2.

Task 1

Write code in FizzBuzz that produces the following output for each number in a contiguous range of integers:

  1. the number itself
  2. fizz for numbers that are multiples of 3
  3. buzz for numbers that are multiples of 5
  4. fizzbuzz for numbers that are multiples of 15

Being careful to avoid trailing spaces.

E.g. 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

Task 2

Please enhance your existing FizzBuzz (you can use for that AlfrescoFizzBuzz) solution to perform the following:

If the number contains a three you must output the text alfresco, any other rule is skipped.

E.g. running the program with a range from 1-20 should produce the following result:

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages