6 kyu
Coffee machine
168marko-bekhta
Description:
Your company decided to buy a CoffeeMachine
from a CoffeeMachineFactory
.
After some time your boss starts to suspect that employees are not drinking the coffee from the machine. So you are asked to find a way and improve the machine to track how much coffees were taken from the machine. And as your boss likes statistics he would also like to know how much of each kind of coffee the machine produced.
So here you are - one on one with CoffeeMachine
:
public interface CoffeeMachine {
Coffee makeCoffee();
}
which produces coffees:
public class Coffee {
//...
public final String getType() {
return type;
}
}
bought from CoffeMachineFactory
:
public class CoffeeMachineFactory {
public static CoffeeMachine buyCoffeeMachine() {
....
}
}
Can you figure it out?
Puzzles
Fundamentals
Similar Kata:
Stats:
Created | Aug 1, 2017 |
Published | Aug 1, 2017 |
Warriors Trained | 652 |
Total Skips | 43 |
Total Code Submissions | 645 |
Total Times Completed | 168 |
Java Completions | 168 |
Total Stars | 16 |
% of votes with a positive feedback rating | 91% of 43 |
Total "Very Satisfied" Votes | 37 |
Total "Somewhat Satisfied" Votes | 4 |
Total "Not Satisfied" Votes | 2 |
Total Rank Assessments | 6 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 7 kyu |