0
C# It’s a dirty code.How to do clear code?Why the test 4th fail?Это грязный код.Как сделать чистый код?Почему 4тест не проходит?
C# It’s a dirty code. How to do clear code? Why the test 4th fail?Это грязный код. Как сделать чистый код? Почему 4-ый тест не проходит? https://code.sololearn.com/cVlh76Y5zg6n/?ref=app
6 Respuestas
+ 2
You should read a guide about OOP, especially how to use properties. And also read about OO analysis and design. I think you wanted to do a class structure like for a shopping cart in online shopping but your classes don't reflect that very well. The values you set in constructor should all come from outside as parameters or via property setters.
But regarding the challenge you don't need all that. A simple formula to calculate the output from the input would suffice.
Regarding the failed test I think it is just a matter of rounding. Since you are rounding to the nearest decimal, which results in rounding up for odd inputs >1, try rounding down (Math.Round with MidpointRounding.ToZero)
0
may be show me?)) and I check this code here
0
only with OOP
0
and say you fail or not fail
0
without structure, clear OOP
0
Product, Category, Order and etc))