This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| You are given a story from Product Owner. He wants to integrate a calculator to the banking app. You may ask clarification quiestions in needed. | |
| You need to write a prodcution-ready function public int calculate(int a, int b, char operator). | |
| This method should return the result of applying the operator to the two numbers. | |
| Supported operators are '+' for addition, '-' for subtraction, '*' for multiplication, and '/' for division. | |
| For example: calculate(4, 2, '+') should return 6, calculate(10, 3, '-') should return 7, calculate(3, 5, '*') should return 15, and calculate(8, 2, '/') should return 4. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Service | |
| public class UserSrvc { | |
| public UserRepository mySrvc; | |
| public UserSrvc() { | |
| this.mySrvc = new UserRepository(); | |
| } | |
| public User doSmthngImportant(Long id) { | |
| if (id == null) { |