8 kyu
Calculate Price Excluding VAT
872 of 9,801payer.cse
Loading description...
Mathematics
Fundamentals
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
This comment has been hidden.
This comment has been hidden.
thanks.
This comment has been hidden.
I've got it all figured out :)
Expected: '106.96', instead got: ''106.96'' what is wrong with you author???
Your solution returns a value of an incorrect type.
my bad
" Expected: '106.96', instead got: ''106.96'' "
uhhh what?
[JS]
I'm having the same issue! It says to round to two decimal places, but I also got " Expected: '200', instead got: ''200.00'' "
Use porcentage reverse to make this count.
I have no idea why I have to use VAT = 13.04 for the results to be correct when the exercise said that VAT is always 15%.
not an issue.
1/1.15=...?
;) (edit: well, it's not exactly that, but it's along this idea)Java Translation Translation in Java
Just bad kata - why would you put null as param and expect -1;
no idea
Not a kata issue!
This comment has been hidden.
This comment has been hidden.
resolved, i guess?
No idea how with my kinden garden math i managed to solve this.
The input validation is worthless; it should be removed or actually tested in random tests.
This comment has been hidden.
why would you want to put a bool in a calculator :(
steer clear in Python. Tried, even with someone elses top-rated response and it gave me an error. Something broke and they're not checking.
It works fine in Python, could you clarify what's your problem about?
Your solution is working fine but you have to take care of None as well( accd to question).
FYI: there is absolutely no sense on this task.
That single test case with price = 0 killed me :D
Is there a reason why I needed to divide by 1 to get everything to be correct? My answers were '/'200/'' but it expected '200'? Why is that?
'200'
is a string (probably fromtoFixed
?),200
is a number.Ah. Makes sense. Thanks so much.
Hi...I'm having trouble with this fail on the edge case "Expected: '0', instead got: '-1'". Its passing all other tests. Any ideas...Thanks!
0 is not null
If (price)=== null , given then return -1
omg, thanks man!
Approved and added random tests to JavaScript
Could do with a fixed test for
solve(0)
( as opposed tosolve(null)
).I should not have been able to get away with this. :P
As you wish
Random tests added to python, function name updated to snake_case, and description tidied up a bit.
Failed asserting that -1 matches expected 0.0.
Um...0.0 is not rounded to 2 decimal points. It should expect 0.00.
If (price)=== null, задано тоді повертає -1
Some random test cases would be nice. Also, I'm really nitpicking here but I saw some of the test cases expecting values rounded to 1 decimal places (i.e 200.00 was 200.0)
It's not much but it still got me wondering for a second if I should round to two decimals like you said in the question or if it should be one, so, just thought I'd point that out. Otherwise, nice kata!
That's a huge amount of fixed tests you've got there, good job :) However, I would still like to suggest the inclusion of randomly generated test cases at runtime.
Random tests are already available in all languages.
It says to work out the cost, excluding VAT. However, it does not tell you the rate of VAT that has been applied to the product in the first place.
The description does make mention of a 15% VAT; however, I do agree that it is unclear that the VAT is 15% in all cases. I will edit the description to make that a bit clearer.
Description edited to clarify this
i like it.
Hi, two things:
Regards,
suic
Thanks for your suggestion
1e-2
Resolving.